Sample Connection Strings

The following is a list of connection string formats for the most common database types:

DBase / FoxPro

 

Driver={Microsoft dBASE Driver (*.dbf)};Dbq=<c:\data>;

 

Where <c:\data> is the folder where the files are stored

Firebird

 

DRIVER=Firebird/InterBase(r) driver;uid=sysdba;pwd=secret;dbname=<c:\data>\test.fdb

 

Where the database resides in the <c:\data> folder

Informix

 

Using WinSQL Professional Informix Wire Protocol

DRIVER={WinSQL Professional Informix Wire Protocol};uid=yourID;PWD=secret;host=yourServerIP;port=1526;DB=YourDatabase;srvr=ol_yourdb

 

Using Informix driver from IBM

Driver={INFORMIX 3.30 32 BIT};Host=hostname;Server=myserver;Service=ol_yourdb;Protocol=olsoctcp;Database=mydb;UID=username;PWD=myPwd

 

Where <ol_yourdb> represents the server name from sqlhosts file on the Informix server

IBM DB2

 

Using WinSQL Professional DB2 Wire Protocol Driver

Driver={WinSQL Professional DB2 Wire Protocol};Database=myDbName;IpAddress=myServerName;port=myPortNum;protocol=TCPIP;uid=myUserName;pwd=secret

 

Using IBM Driver

 

Driver={IBM DB2 ODBC DRIVER};Database=myDbName;hostname=myServerName;port=myPortNum;protocol=TCPIP;uid=myUserName;pwd=secret

Mimer

 

Driver={MIMER};Database=yourDatabase;uid=yourUserID;Pwd=secret;

MS Access

 

Standard Security

Driver={Microsoft Access Driver (*.mdb)};Dbq=c:\mydb.mdb;Uid=Admin;Pwd=;

 

Workgroup

Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\mydb.mdb;SystemDB=C:\mydb.mdw;

 

MS Excel

 

Driver={Microsoft Excel Driver (*.xls)};Dbq=c:\MyExcel.xls;DefaultDir=c:\mypath;

MS SQL Server

 

Using SQL Server Security

Driver={SQL Server};Server=YourServerIP;Database=YourDB;Uid=sa;Pwd=secret

 

Using Trusted Connection

Driver={SQL Server};Server=YourServer;Database=YourDBName;Trusted_Connection=yes

 

Using TCP/IP with on a non-standard port

Driver={SQL Server};Server=192.168.1.50,4321;uid=sa;pwd=secret;Database=YourDB;

MySQL

 

DRIVER={MySQL ODBC 3.51 Driver};server=YourServerIP;PORT=3306;database=myDatabase;user=myUsername;password=secret;option=3

Oracle

 

Using WinSQL Professional Wire Protocol Driver

Driver={WinSQL Professional Oracle Wire Protocol};host=tarzan;port=1521;Uid=scott;
Pwd=tiger;sid=orcl

 

Using WinSQL Professional Driver

DRIVER={WinSQL Professional Oracle};uid=SCOTT;pwd=tiger;SRVR=orcl

 

Using Microsoft Driver

Driver={Microsoft ODBC for Oracle};UID=scott;PWD=tiger;SERVER=ORCL;

 

In the previous two examples, the variable SERVER and SRVR refers to the name in TNSNAMES.ORA file on your machine. Note that WinSQL Professional Wire Protocol Driver, used in the first example, does not need TNSNAMES.ORA file.

 

If you are using Oracle’s ODBC driver, the name of the driver is different on every machine. Refer to the ODBC Data Source Administrator to obtain the driver name.

Paradox

 

Driver={Microsoft Paradox Driver (*.db )};DBQ=c:\data\;DefaultDir=<c:\data\>;

 

Where <c:\data> is the folder where the files are stored.

PostgreSQL

 

Driver={PostgreSQL};Server=ipaddress;port=5432;Database=yourDBname;uid=yourId;pwd=secret;

Sybase

 

Using WinSQL Professional Sybase Wire Protocol

Driver={WinSQL Professional Sybase Wire Protocol};uid=sa;pwd=secret;NA=goofy,5000;DB=YourDatabaseName

 

Using Sybase Open Client Driver

Driver={SYBASE ASE ODBC Driver};Srvr=YourServerName;Uid=sa;Pwd=secret

Text Files

 

Using WinSQL Professional Text File driver

Driver={WinSQL Professional Text File};DB=c:\data\

 

Using Microsoft Text Driver

Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=c:\data\;Extensions=asc,csv,tab,txt;