>Hi All,
>
>Does anyone have an idea how can i test to see if my ORACLE 8i database is running?
>I need to know that before i try to connect so my app doesn't crash.
>
>
>
>Thanks
>
>Dejan
When you use either SQLCONNECT or SQLSTRINGCONNECT, you should be able to test the return value of the connection handle. If it is < 0, the connection was not made.
If you've already made a connection, testing it before use is a little harder. For SQL Server, I do the following:
PROCEDURE test_connection(tnHandle)
LOCAL lcOnError, llError
lcOnError = ON("ERROR")
ON ERROR llSuccess = .f.
llSuccess = SQLEXEC(tnHandle, "select 1")
ON ERROR &lcOnError
RETURN llSuccess
ENDPROC
Hope that helps.
Dan LeClair
www.cyberwombat.comSET RANT ON - The Wombat BlogLife isn’t a morality contest and purity makes a poor shield. - J. Peter MulhernDisclaimer: The comments made here are only my OPINIONS on various aspects of VFP, SQL Server, VS.NET, systems development, or life in general, and my OPINIONS should not be construed to be the authoritative word on any subject. No warranties or degrees of veracity are expressed or implied. Void where prohibited. Side effects may included dizziness, spontaneous combustion, or unexplainable cravings for dark beer. Wash with like colors only, serve immediately for best flavor.