
734
Part IV
Incorporating Dynamic Data
A DSN-less connection uses the same driver as a DSN connection, but without relying on the defini-
tion of a Data Source Name. The syntax of a DSN-less connection varies for each type of database,
but basically has five parts:
Provider
■■
—The underlying mechanism that connects the ODBC driver to the application.
For ODBC drivers, the provider is MSDASQL; because the provider is always the same for
ODBC, the entry is optional in a connection string and understood if omitted.
Driver
■■
—The proper name of the driver as listed in the ODBC Data Source Administrator.
Path to data source
■■
—Typically, this full path to a database is called the DBQ; however,
with some data sources, such as Oracle and SQL Server, this parameter appears in two
parts, listing both the server and the database name.
Username
■■
—The username, if any, required for access to the data source. This element is
often abbreviated
UID in a connection string.
Password
■■
—The password, if any, required for access to the data source. This element is
often abbreviated
PWD in a connection string.
Here’s an example of a DSN-less connection string to an Access database named
dbaEvents.mdb:
Provider=MSDASQL;Driver={Microsoft Access Driver i
(*.mdb)};DBQ=c:\clients\dba\data\dbaEvents.mdb;UID=jlowery;PWD=hoosier7;
If the same data source were in SQL Server format (on a server named euripedes), the DSN-le ...