Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CursorAdaptor and Connection Handles
Message
From
01/01/2008 21:40:18
Aye Mya Thida Kyaw
Ingenuity Microsystems Sdn Bhd.
Kuala Lumpur, Malaysia
 
 
To
28/12/2007 09:38:44
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
MS SQL Server
Miscellaneous
Thread ID:
01277275
Message ID:
01278864
Views:
25
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform