Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to sure the connection still connected
Message
From
07/09/2001 03:21:57
 
 
To
07/09/2001 02:58:47
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00553609
Message ID:
00553616
Views:
12
This message has been marked as the solution to the initial question of the thread.
Hi!

Just try to run a simple query:
lc___OldError = ON("ERROR")
ON ERROR llError = .T.
llError = .F.

llConnectionIsValid = SQLEXEC(nConnectHandle,"SELECT 1 as Test","TestResult")>0 and used("TestResult")
if llError
  llConnectionIsValid = .F.
endif
if used("TestResult")
  use in TestResult
endif

ON ERROR &lc___OldError
After above code llConnectionIsValid will contain .T. if connaction is still working.

HTH.

>Dear friends,
>
>I'm developing a client/server application. I made the connection between SQL server and client using SQLStringConnect command at the program start. And the connection handle will be shared within the program. But how can I check the connection is still connected before update or retrieve the data. I'm a beginner for CS application. Thank you for your help and advice.
>
>Best Regards,
>
>Justy Chow
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform