Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to know my server is on?
Message
De
21/01/2001 09:24:55
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00465537
Message ID:
00466342
Vues:
13
>Hi John
>
>If you are working with VFP data on a fileserver, you can first do a general check, if the path to the data is ok, and the dbc is available.
>
>FILE("myDataBase.DBC")
>
>This will return .F., when the server or the connection is down.
>
>The attempt to open the .dbc With OPEN DATABASE myDataBase will give you an error #1 in this case too. If you haven't the according user rights to access that .dbc you'll see an error #1705. So you can handle this in all in an error routine.
>
>If you are working with a "real" server your attempt to establish a connection by using SQLCONNECT() or SQLSTRINGCONNECT() will return -1 if it fails.
>
>HTH
>Markus
>
>
>>Hi,
>> I am developing multiuser application. I faced a problem that, my application will be hang/error if the server is not switch on, not connect to network or access permission is not set properly.
>> How to implement a TestConnection function to check these issue before I open database ?
>>
>>Thank you

Mark's method has been tried by me and is absolutely a No no. I had a site as you describe, only it was a workstation that a program had to access to update data on the server. If the WS was offline the server would go into nether land, completely (almost) freezing the server while looking for the WS and control returned only after a while. Totally inefficient.

The solution I use now which returns a result instantaneously(sp?) is the VFP command DISKSPACE(). Try it and see! and then try IF FILE(MYFILE) etc with the computer connected and without.

Believe me DISKSPACE works.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform