I've looked around but i'm having trouble finding what i need. I need to catch the SQL error output for a statement.
Example:
Global $adoCn = ObjCreate( "ADODB.Connection" )
$adoCn.Properties("Prompt") = 2; 1=PromptAlways, 2=PromptComplete
$ConnectionString = "DRIVER={Oracle in instantclient_11_2};data source=src"
$adoCn.ConnectionString = $ConnectionString
$adoCn.Open
If @error Then
MsgBox(0, "Problem", "SQL Connection Failed")
Else
$adoCn.Execute("Blah blah SQL here")
... ?? catch error ?
So i can run a SQL statement. and something like "Select * from dba_users" is easy to catch. if my record set is zero then i can do some error code.
Problem is i'm trying to write a little tool that can manage passwords. so i want to do an "alter user identified by "xxxx"" Statement. there's no return and if the alter fails i want to get back the error why (maybe password was too weak or other reasons)
But @error doesn't seem to contain anything from the sql. in fact i'm not even sure how to continue the script . seems the whole thing just dies with a "The requested action with this object has failed.:" error.