Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to check from client if ORACLE service is running
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00623554
Message ID:
00623796
Views:
10
It totally befuddles me why SQL Server allows DML without a FROM clause. In Oracle the test would be SELECT 1 FROM DUAL.

>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)
>                * tnHandle is the number of the connection handle
>
>		LOCAL lcOnError, llError
>
>		* turn the error handler off
>		lcOnError = ON("ERROR")
>
>		ON ERROR llSuccess = .f.
>		
>		llSuccess = SQLEXEC(tnHandle, "select 1")
>		
>		* restore the regular error handler
>		ON ERROR &lcOnError
>		
>		RETURN llSuccess
>	ENDPROC
>
>
>
>Hope that helps.
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform