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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only