Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> No response from oracle adodb call that updates User Password via an Alter User Command.

No response from oracle adodb call that updates User Password via an Alter User Command.

From: lbj <lyndonjohnson_at_execpc.com>
Date: 2000/06/12
Message-ID: <394550c2$2$28612$39368dfe@news.twtelecom.net>#1/1

I have coded an asp module that allows a user to change their password. It is called by another module that passes the Userid and Passwords. I am running into a problem where the code works 4 times consecutively and hangs on the subsequent fifth run.

I am looking for some suggestion as to what syntax or coding sequence error that I made:
Thank you in advance: lyndonj_at_execpc.com

Here is the asp code:

<%@ LANGUAGE="VBSCRIPT" %>
<%

'---------------------------------------------------------------------------

' PassChangeProcess
' This page does the actual changing of the RCS password
' Called from PassChange.asp
'---------------------------------------------------------------------------


'Option Explicit
%>

<%
 Dim strSQL
 Dim objRs
 dim objFSO
 DIM objTStream
 Dim ForReading
 Dim strFileName
 DIM UserID, strDSN
 dim strDSNa
 Dim objConn
 Dim cmdTemp
 Dim rsPassChange
 Dim strNewPass
 Dim strUserId, strPrevPass

 strNewPass  = Request.Form("txtNewPass")
 strUserId   = Request.Form("txtOldPass")
 strPrevPass = Request.Form("txtPrevPass")
'response.write "UserId      " & strUserId  & "<BR>"
'response.write "stroldpass " & strPrevPass & "<BR>" 'response.write "strNewPass " & strNewPass On Error Resume Next
 'DEVELOPMENT ENVIROMENT
 'strFilename = "e:\dsstools\security\security.ini"
 'PRODUCTION ENVIROMENT
 'strFilename = "e:\MSTR6\security\security.ini"
 'PERSONAL   ENVIROMENT

 strFilename = "D:\MSTR6\security\security.ini"  'Set objFSO = Server.CreateObject("Scripting.FileSystemobject")  Set objFSO = CreateObject("Scripting.FileSystemobject")  'TRUE = -1,
 IF objFSO.FileExists ("D:\MSTR6\security\security.ini") THEN   Set objtstream = objFSO.OpenTextFile(strfilename, 1, TRUE)   Do While Not objTStream.AtEndOfStream
   strLineText = objtstream.readline
   'Response.Write (strlinetext) & "<BR>"    'Session("strMessage") = cstr(strLineText)    UserID = Mid(cstr(strlinetext),1, 7)
   strDSN = Mid(cstr(strlinetext),9)
   strDSNa = "dsn=" + strdsn + ";uid=" + UserID + ";pwd=" + strPrevPass + ";"

   'Session("strMessage") = strDSNa
   IF lcase(strUserId) = lcase(Userid) then

'---------------------------------------------------------------------------

    'Open Database Connection

'---------------------------------------------------------------------------

    'OpenConnection
    Set objConn = Server.CreateObject("ADODB.Connection")

     objConn.Open strDSNa
     If Err.Number <> 0 Then

'---------------------------------------------------------------------------

----
'Close Database Connection '---------------------------------------------------------------------------
----
objConn.Close Session("strMessage") = "Your Old password is invalid - please try again. Contact your " & _ "account coordinator at M&I Data Services if you continue to have problems." Else '---------------------------------------------------------------------------
----
'Update User Password '---------------------------------------------------------------------------
----
Set cmdTemp = Server.CreateObject("ADODB.Command") Set rsPassChange = Server.CreateObject("ADODB.Recordset") cmdTemp.CommandText = "ALTER USER " & strUserId & " IDENTIFIED BY " & strNewPass & "" cmdTemp.CommandType = 1 Set cmdTemp.ActiveConnection = objConn rsPassChange.Open cmdTemp, , 1, 3, 1 If Err.Number <> 0 Then Session("strMessage") = "Your new password was invalid - please try a different password." & _ " Contact your account coordinator at M&I Data Services if you
continue to experience problems."
'---------------------------------------------------------------------------

----
'Close Database Connection - must be in the "If" and the "Else" to avoid Err.number being reset 'to zero by the On Error Resume Next command in the CloseConnection
routine
'---------------------------------------------------------------------------

----
ELSE objConn.CommitTrans Session("strMessage") = "Your new password is set" END IF objConn.Close rsPassChange.Close End If

   end if
  loop
 ELSE
  Session("strMessage") = "Security File is Missing." & _   " Contact your account coordinator at M&I Data Services if you continue to experience problems."
 END IF
 objtstream.close
 Set objConn = Nothing
 Set objFSO = Nothing
 Set objtstream = Nothing
 Set rsPassChange = Nothing
 Set cmdTemp = Nothing
 Response.Redirect "OrclPassChge.asp"
%> Received on Mon Jun 12 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US