Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ODBC cursoradapter
Message
 
 
À
04/11/2003 02:08:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00845913
Message ID:
00845964
Vues:
19
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform