I'm writing an asp page that gets userid, password, and new password from a form. The asp then does a connect to Oracle, and issues an alter user.
My Connection to Oracle works. I did the following.
-----------------------------------------------------------
On Error Resume Next
Set objConn = Server.CreateObject("ADODB.Connection"
objConn.Open "dsn=PRD16;uid=" & Userid & ";pwd=" & Password & ";"
If objConn.errors.count > 0 then
Response.write("Database Errors Occured" & "<P>"
For counter= 0 to objConn.errors.count
Response.write("Error #" & objConn.errors(counter).number & "<P>"
Response.write("Error desc. -> " & objConn.errors(counter).description & "<P>"
Next
Else
' Connection worked
End if
------------------------------------------------------------
What doesn't work is the alter user command. the command in Sql would be:
alter user userid identified by "NewPassword";
What I coded in asp is.
------------------------------------------------------------
On Error Resume Next
objSQL = Server.CreateObject("ADODB.Command"
set objSQL.ActiveConnection = objConn
StrCommand = "alter user " & Userid & " identified by """ & NewPassword & """;"
objSQL.execute StrCommand
If objSQL.errors.count > 0 then
Response.write( objSQL.errors.count & "Errors Occured while setting password" & "<P>"
Response.write objSQL.errors.count
For counter= 0 to objSQL.errors.count
Response.write("Error #" & objSQL.errors(counter).number & "<P>"
Response.write("Error desc. -> " & objSQL.errors(counter).description & "<P>"
Next
else
response.write("nO ERRORS"
end if
----------------------------------------------------------
This doesn't work. I don't get an error returned from the DB. Funny thing is that the "nO ERRORS" doesn't display either, as if it jumps over the entire IF Structure.
I'm a true asp newbie, so any help would be most appreciated.
Thanks.
My Connection to Oracle works. I did the following.
-----------------------------------------------------------
On Error Resume Next
Set objConn = Server.CreateObject("ADODB.Connection"
objConn.Open "dsn=PRD16;uid=" & Userid & ";pwd=" & Password & ";"
If objConn.errors.count > 0 then
Response.write("Database Errors Occured" & "<P>"
For counter= 0 to objConn.errors.count
Response.write("Error #" & objConn.errors(counter).number & "<P>"
Response.write("Error desc. -> " & objConn.errors(counter).description & "<P>"
Next
Else
' Connection worked
End if
------------------------------------------------------------
What doesn't work is the alter user command. the command in Sql would be:
alter user userid identified by "NewPassword";
What I coded in asp is.
------------------------------------------------------------
On Error Resume Next
objSQL = Server.CreateObject("ADODB.Command"
set objSQL.ActiveConnection = objConn
StrCommand = "alter user " & Userid & " identified by """ & NewPassword & """;"
objSQL.execute StrCommand
If objSQL.errors.count > 0 then
Response.write( objSQL.errors.count & "Errors Occured while setting password" & "<P>"
Response.write objSQL.errors.count
For counter= 0 to objSQL.errors.count
Response.write("Error #" & objSQL.errors(counter).number & "<P>"
Response.write("Error desc. -> " & objSQL.errors(counter).description & "<P>"
Next
else
response.write("nO ERRORS"
end if
----------------------------------------------------------
This doesn't work. I don't get an error returned from the DB. Funny thing is that the "nO ERRORS" doesn't display either, as if it jumps over the entire IF Structure.
I'm a true asp newbie, so any help would be most appreciated.
Thanks.