Example | data | database | database connection | String using DSN's database connection string example:
MS Sql/mysql/postgresql
"Dsn=dsnname"
Do not use DSN database connection string Example:
MS Access
via OLE DB:
"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:somepathmydb.mdb; "
MS SQL
Through ODBC:
"Driver={sql Server}; Server=myservername; Database=mydatabasename; Uid=myusername; Pwd=mypassword "
With OLE DB (recommended):
"Provider=sqloledb; Data Source=myservername; Initial Catalog=mydatabasename; User Id=myusername; Password=mypassword "
Mysql
Through ODBC:
"Driver={mysql ODBC 3.51 Driver}; Server=servername; Database=dbname; Uid=username; Pwd=password; Option=3 "
PostgreSQL
Through ODBC:
"Driver={postgresql}; Server=servername; Database=dbname; Uid=username; Pwd=password "
For an MS Access database, because the ODBC driver for an Access database can cause instability, it is best not to connect through DSN.