Hi
The best you can do is to set IdleTimeout for connection.
After time specified, VFP disconnects from server and reconnects next time you make any updates on server. This also will reconnect server side intrerrupted connections, but only after time specified in IdleTimeout.
In VFP9 is even better, exists SQLIDLEDICONNECT() function , which can be used to reconnect a broken SQL connection (server restarts, network problems, server automatic connection interrupts, etc)
>Hello everbody !
>
>At the beginning of my application (vfp 7.0) i connect to a serverdb (maxdb) !
>
>public p_verbindungsnr
>STORE SQLSTRINGCONNECT('dsn=maxdblokal;uid=xxxx;pwd=xxxxxx') TO p_verbindungsnr
>If p_verbindungsnr < 0
> error ....
>endif
>
>I use the connectionhandle "p_verbindungsnr" in all my sql-commands in all forms
>
>Of course i don't know how long the users stay in the application and if they are working or sleeping ;-)
>
>I some situations the maydb database disconncets the session (timeout) to avoid deadlock situations .........
>
>So i want to test the validity of the connectionhandle before each sql-command and if not do an automatic reconnect.
>
>I my application the public connectionhandle "p_verbindungsnr" is still > 0
>I don't know how to test the validity of p_verbindungsnr ??
>
>Any help welcomed
>
>Best regards
>Albert
Précédent
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