Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ODBC cursoradapter
Message
 
 
To
04/11/2003 02:08:40
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00845913
Message ID:
00845964
Views:
17
>Can somebody tell me if there is a problem using the same user and password for a ODBC connection to a SQL Server. In the cursoradapter builder I have to specify a username and password. I intend to use the same user for the entire application. Is there a better way? How can I build the cursoradapter and use the username and password programaticly?

Just create a shared connection using SQLSTRINGCONNECT() function. Then set the DataSource property of your CursorAdapters to the variable or property that is holding that connection value. For example, I have a global application object that I create when the app is launched. I create a shared connection with SQLSTRINGCONNECT() function and store that con handle to goApp.nConnectionHandle. For my CA base class, I set the DataSource property to =goApp.nConnectionHandle in the Property Sheet. If you are doing this in the Property Sheet of the CA, you need to precede the value with the equal sign. Otherwise, the property or memory variable is stored as a character string.

When your app is shutdown, just use SQLDISCONNECT() function to terminate the connection.
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform