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
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement