Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best Practice- Use Connections in DBC or ODBC
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 6 SP5
Database:
Visual FoxPro
Divers
Thread ID:
00964163
Message ID:
00964739
Vues:
10
This message has been marked as a message which has helped to the initial question of the thread.
Hi Bhavbhuti.

>I just want to know which is better, if that is the case, Connection in a DBC or directly the ODBC DSN?

My preference is to use neither.

- Storing a connection in a DBC means that the user name and password are stored in clear text in the a memo field, so someone could easily find them using nothing more than Notepad.

- A connection stored in the DBC is hard-coded -- you can't change the server name, database name, user name, or password without recreating the connection.

- Using a DSN means the DSN has to exist on the user's system. Also, like a connection stored in a DBC, the connection information is hard-coded.

I prefer to use a DSN-less connection -- that is, a connection string. That way, you can change any of the connection information as necessary, especially if you store the values in an INI file or table (which can, of course, be encrypted). Starting in VFP 7, you can open a remote view with the CONNSTRING clause to specify the connection string to use, such as:

USE MyRemoteView CONNSTRING "driver=SQL Server;server=whatever;database=whatever;uid=whatever;pwd=whatever"

Doug
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform