Unhandled Structured Exception.
ErrorNo: 1466
Message: Connection handle is invalid.
UserValue:
Cancel Ignore Help
I'm sure it has to do with code I just put in to check a sql database
for a flag field and if it's false set another to true etc. What do you
think I missed--closing a connecting before opening it or ???
Have you tried trapping the error and checking the array created by
AError()?
Dan
>What do you think I missed--closing a connecting before opening it or ???
the connection handle you use isn't valid.
Most probably the connection failed
or is broken in the moment you sent
your query.
Bye, Olaf.
Thanks,
cj
"cj2" <c...@nospam.nospam> wrote in message
news:usDy4wB9...@TK2MSFTNGP05.phx.gbl...
The reason a TRY CATCH doesn't work with SQLCONNECT() and
a failing connection is, that this does not raise an error, but SQLCONNECT()
simply returns -1 as "the handle", which is an invalid connection handle.
Bye, Olaf.
When SQLCONNECT() returns -1 you can anyway call AERROR(MyErrorArray)
to obtain detailed information about the ODBC error.
Take a look at AERROR() in VFP help.
--
Gianni
True, it's one of the cases AERROR() gives
further info although there was no vfp system
error, but the error was eg at the remote+
database.
Other situations are, when TABLEUPDATE()
returns .F., SQLEXEC() returns -1 and also after
eg a CursorAdapter.CursorFill() returns .F.
For example the topic on CursorFill states:
To retrieve error information when CursorFill returns
False (.F.), you must call the AERROR( ) Function
function because Visual Foxpro error handling, such
as the ON ERROR command, Error event, and
TRY...CATCH...FINALLY command, does not
capture this error information.
Bye, Olaf.
Thanks.