Managing DAO Data Source Name Entries

Generally, an ODBC connection requires a Data Source Name (DSN) entry. Depending on the operating system, these entries are either kept in the ODBC.ini file (16-bit systems) or in the system registry (32-bit systems). You should not attempt to change these entries manually. Instead, use the Windows Control Panel ODBC Administration applet or the RegisterDatabase method.

Note   When using the DAO/Jet model, ODBCDirect, Remote Data Objects, or the ODBC API, it is not always necessary to create or reference a registered DSN if enough information about the remote server is provided in the connect string.

Setting the Default Database

Your code should ensure that the correct default database is set during the connection process. The user may specify a user ID that does not have permission to access the database your application expects to use, or uses a different default database. The default database can be established by: