Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best Practice - Should the Connection Handle be stored
Message
De
22/11/2005 01:59:03
 
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:
01071068
Vues:
15
>
>Aah, this is interesting to me, I was getting the handle from the open remote view. I guess I will have to study SQLConnect and SQLDisconnect to get the connection the real way. My concern had come from the way I was obtaining the handle, from the View, so my concern was what when the DBC was closed and reopened would the handle be still valid, but your way I do not think that will ever be a problem, as the handle was obtained independently.
>
>Thanks a lot.

You are welcomed.

If you use remote views stored in the DBC, remember to set the SHARED property to .T. for all of them to use this method, otherwise they will still open a new connection each time.

DBSETPROP(cRemoteViewName, "VIEW", "ShareConnection", .T.)

Also use the correct version of SQLCONNECT so all your remote views can share the connection:

.ConnectionHandle = SQLConnect(cConnectionName, cUserID , cPassword, .T.)

Where cConnectionName is the name of the Connection used by the remote views.

And why would you close the Database in the middle of your application?

And I almost forget, of course do a (for example):

Open Database (goApp.DBCName)

before using SQLConnect

Carlos
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform