Home

DSNs

Data Source Name (DSN) is a named set of connection parameters used by ODBC-compliant applications to access a data source. A DSN encapsulates the information needed to establish a connection, such as the database driver, server address, database name, and authentication details, so that applications can connect without hardcoding these values.

DSNs can be created and stored in different ways. In Windows, DSNs may be defined as User

Applications request connections by referring to a DSN rather than a set of individual parameters. The ODBC

On Unix-like systems, DSNs are defined in the odbc.ini file, and drivers are described in odbcinst.ini. This

DSNs provide portability and centralized management for database connections, but they require careful handling of credentials

DSNs
(accessible
to
a
single
user)
or
System
DSNs
(accessible
to
all
users
on
a
machine),
and
there
is
also
a
File
DSN,
which
is
a
text
file
containing
key-value
pairs.
The
locations
differ:
Windows
DSNs
are
kept
in
the
registry,
while
File
DSNs
are
stored
as
.dsn
text
files.
Driver
Manager
reads
the
DSN,
loads
the
appropriate
driver,
and
uses
the
supplied
fields
(driver,
server,
database,
and
optional
credentials)
to
open
the
connection.
Passwords
may
be
stored
in
the
DSN
file
or
managed
by
the
driver,
depending
on
driver
and
policy.
convention
mirrors
Windows
in
concept
but
uses
plain
text
configuration
files.
DSN-less
connection
strings
are
also
common,
where
the
application
provides
the
driver
and
connection
details
directly
instead
of
using
a
DSN.
and
permissions,
particularly
for
system-wide
DSNs.
They
are
primarily
used
in
the
context
of
ODBC,
with
similar
concepts
in
other
data
access
technologies.