Difference between DSN and connection string

How different between DSN and connection string? It's not clear.

1 answer


A DSN (Data Source Name) is an identifier which defines a data source for an ODBC driver.

A DSN consists of information such as:

  • Database name
  • Directory
  • Database driver
  • User ID
  • Password

Connection String

A connection string is a string that specifies information about a data source and the means of connecting to it. It is passed in code to an underlying driver or provider in order to initiate the connection

DSN use in a connection string