>Does anyone know how to test the actual ADODB connection to determine if it is open or not? In the application I am using, I can't simply test to see if an ADODB object has been instantiated. I need to test the connection itself.
>
>Thanks in advance
You can SELECT anything to determine if your connection is up and working. This also answers you question about how to prevent error messages from occuring if your connection has gone bad.
function isConnectionOpen
lparameters oConnection
local lcOldError, err, ors, llReturnValue
lcOldError = on("error")
err = .f.
on error err = .t.
ors = oconnection.execute("Select 'GoodConnection' as 'success'")
on error &lcOldError
if err
llReturnValue = .f.
else
llReturnValue = !(ors.eof())
endif
if llReturnValue
ors.close()
release ors
endif
return llReturnValue
endproc
HTH,
Steve Gibson