Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to sure the connection still connected
Message
 
 
À
07/09/2001 02:58:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00553609
Message ID:
00553616
Vues:
11
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform