Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CA RecordRefresh()
Message
De
08/04/2021 16:20:42
Walter Meester
HoogkarspelPays-Bas
 
 
À
08/04/2021 16:08:48
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., Nouvelle Zélande
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01679671
Message ID:
01679698
Vues:
60
J'aime (1)
Actually, that is a funny story. As I initially had the same question on how to build this into our already vast application.

The handle in our application is stored in the Applic.SQLHandle property. I ended up using the Applic.SQLHandle_Access method to execute an empty SQL Statement if the last SQL statement was more than 5 seonds ago.

When that fails on a connection error, it calls the Reconnect method with the code below is used to revive the connection.
It miraculously even worked on Remove Views (I know your fav topic :))

The method has been proven to be very robust for us.

Walter,




>Hi Walter,
>
>
>			ASQLHANDLES(aSqlhndls)
>			FOR EACH nOdbchdbc IN aSqlhndls
>				=SQLIDLEDISCONNECT(nOdbchdbc)
>			ENDFOR
>
>
>
>Nice trick. A few questions:
>
>1) Where do you put this- in a sqlexec() method or an object error method or ??
>2) Would sqldisconnect(0) suffice if you're closing them all?
>3) Do you ask the user whether to keep trying before you terminate the app?- J
>
>Regards, J
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform