Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement