Use DSN's database connection character case:
MS SQL / MYSQL / PostgreSQL
"DSN = DSNNAME"
Unused DSN Database Connection Characters:
MS Access
Use OLEDB:
"Provider = microsoft.jet.Oledb.4.0; data source = c: somepathmydb.mdb;"
MS SQL
Use ODBC:
"Driver = {SQL Server}; server = myservername; database = mydatabaseename; uid = myusername; pwd = mypassword"
Use OLEDB (recommended):
"Provider = sqloledb; data source = myservername; initial catalog = myDatabaseName; user ID = myusername; password = mypassword
Mysql
Use ODBC:
"Driver = {mysql odbc 3.51 driver}; server = servername; database = dbname; uid = username; pwd = password; option = 3"
PostgreSQL
Use ODBC:
"Driver = {postgreSQL}; server = servername; database = dbname; uid = username; pwd = password"
For the MS Access database, because the ODBC driver of the Access database can cause unstable, it is best not to connect by DSN.