Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Testing a connection
Message
From
09/12/1998 10:08:51
 
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00165359
Message ID:
00165554
Views:
12
>>Does anyone have a quick method to test a connection handle? I have looked thru the help for SQLGETPROP() and that feature is significantly missing.
>>
>>The only thing that comes to mind is to test for the error message in an error-handler, but if you have a better suggestion, I'd be much obliged if you'd share it.
>>
>>Cheers -
>
>What do mean by test? See if it actually retrieves data? If you are still connected?
>
>There are several SQLGetProp() parameters you can test for. One of which is DispWarnings where you could use SQLSetProp to turn off the display of error messages. You can use AErrors() function to test if an ODBC error was returned.
>
>See the VFP help for parameters on these functions. SQLSetProp has the parameters list for the SQLGetProp function.

By "test", I mean test to see if the handle is still valid (connected). Once the connection is severed, doing any function with it results in an error message.

Thanks -
Dan LeClair
www.cyberwombat.com
SET RANT ON - The Wombat Blog

Life isn’t a morality contest and purity makes a poor shield. - J. Peter Mulhern
Disclaimer: 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.
Previous
Reply
Map
View

Click here to load this message in the networking platform