Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best Practice - Should the Connection Handle be stored
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 6 SP5
Divers
Thread ID:
01070716
Message ID:
01070883
Vues:
16
Bhavbhuti,

A lot of folks, myself included, have created wrapper objects for doing SPT. Typically they will establish the connection, store the handle in a property and then have a method that mirrors the SQLExec() function which will use the handle:
* SQLExec method
...
lnRetVal = SQLExec( this.nHandle, pcSQL, pcCursor )
if ( lnRetVal < 0 )
   aerror( this.aSQLError )
   this.DealWithSPTError()
endif
In the Destory() method you can release the handle with a SQLDisconnect( this.nHandle ) call.

>Whenever I do a SQL Pass-Thru using SQLEXEC() I get the connection handle at the time just before the call to SQLEXEC() with a line as below:
>
	lnConnHnd = CURSORGETPROP("ConnectHandle")
>
>My question is this can I pre-store this handle in the application object goApp as a property? ie. are there any pitfalls if it is not GetProp()ed just before the SQLEXEC() call?
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform