Use DSN database connection string Example:
MS SQL / MySQL / Postgresql
dsn = dsnname
Do not use DSN database connection string example:
MS Access
Through OLEDB:
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 oLEDB (Recomgended):
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 the MS Access database, because the ODBC driver of the Access database can cause unstable, it is best not to connect through DSN.