Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CursorAdaptor and Connection Handles
Message
De
01/01/2008 21:40:18
Aye Mya Thida Kyaw
Ingenuity Microsystems Sdn Bhd.
Kuala Lumpur, Malaisie
 
 
À
28/12/2007 09:38:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
MS SQL Server
Divers
Thread ID:
01277275
Message ID:
01278864
Vues:
23
Hi Dragan & Doug,

Thanks for all the advices.
And Sorry for late response. I was on holiday leave.
Yep. I got the concept. Actually, I already have one public variable which is holding the connection handle. In the initial start up of my application, i build up the connection string and assign the handle number to one Public Variable. Afterward, I use only that variable to connect to SQL Server for wherever in the system regardless of RVs or SPTs. So now should I use the same in CAs? Is this a correct logic?

Here's my CA coding concept. I've a general CA class. And everytime when new object CA is build up, in the "Init" method of CA class :

LPARAMETERS lpDriver, lpServer, lpDatabase, lpUid, lpPwd

LOCAL lnHandle, lcConnString
SQLSETPROP(0, "DispWarning", .F.)
SQLSETPROP(0, "DispLogin", 3)

lcConnString = [driver=]+lpDriver+;
[;server=]+lpServer+;
[;database=]+lpDatabase+;
[;uid=]+lpUid+;
[;pwd=]+lpPwd+;
[;trusted_connection=No]

THIS.NConnHandle = SQLSTRINGCONNECT(lcConnString,.T.)
This.DataSource = THIS.NConnHandle
This.DataSourceType = [ODBC]

THIS.InsertCmdDataSourceType = [ODBC]
THIS.InsertCmdDataSource = THIS.nConnHandle
THIS.UpdateCmdDataSourceType =[ODBC]
THIS.UpdateCmdDataSource = THIS.nConnHandle
THIS.DeleteCmdDataSourceType =[ODBC]
THIS.DeleteCmdDataSource = THIS.nConnHandle


Regards,
Mya
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform