Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to check from client if ORACLE service is running
Message
 
 
À
22/02/2002 11:30:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00623554
Message ID:
00623796
Vues:
8
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform