Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to detect broken connection
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01413992
Message ID:
01413993
Vues:
182
Hi Lynda,

The easiest should be to use connection pooling here. The following code enables connection pooling for the VFP application. You need to run the code before establishing any connection with the SQL server
*========================================================================================
* Code bases on Microsoft KB article Q169470
*========================================================================================
Procedure EnableConnectionPooling

	#DEFINE SQL_ATTR_CONNECTION_POOLING  201
	#DEFINE SQL_CP_ONE_PER_DRIVER 1
	#DEFINE SQL_IS_UINTEGER -5

	Declare Long SQLSetEnvAttr in odbc32.dll Long, Long, Long, Long
	SQLSetEnvAttr(0, SQL_ATTR_CONNECTION_POOLING, SQL_CP_ONE_PER_DRIVER, SQL_IS_UINTEGER)

	SQLSetProp(0,"DispLogin",3)

EndProc
Then don't keep the connection open at all time in your app. Instead connect and disconnect in your application for every transaction.
--
Christof
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform