ODBC Connection Strings
This section describes the ODBC connection strings supported by Pervasive PSQL. This information is provided for advanced users using a database access tool that allows connection strings to be specified and for developers writing ODBC or OLE DB applications to access Pervasive PSQL.
Pervasive PSQL ODBC Driver Names
The following table lists the Pervasive PSQL ODBC drivers.
Use the ODBC Driver parameter to connect to the Pervasive PSQL database engine. For example:
Driver={Pervasive ODBC Engine Interface}
Driver={Pervasive ODBC Client Interface}
Driver={Pervasive ODBC Interface}
Other Parameters
The tables below shows the other parameters that may be used.
DBQ=[@]db_name
UID=user_name
PWD=password
TRANSLATIONDLL=path_and_DLL_name
 
ServerName=server[.port]
ServerDSN=dsn_name
DBQ=[@]db_name
ODBC uses the connection string attribute PvTranslate to specify the data encoding when the client connects to the database engine. The attribute can either be absent or empty, or have a value set to “auto” (for “automatic”).
The PvTranslate attribute can be included with the ODBC function SQLDriverConnect (see Example D) or with SQLConnect (through the DSN setting for automatic encoding).
 
ServerName=server[.port]
DBQ=[@]db_name
ODBC uses the connection string attribute PvTranslate to specify the data encoding when the client connects to the database engine. The attribute can either be absent or empty, or have a value set to “auto” (for “automatic”).
The PvTranslate attribute can be included with the ODBC function SQLDriverConnect (see Example D) or with SQLConnect (through the DSN setting for automatic encoding).
Metadata version is not a parameter in the connection strings. The metadata version is implicitly declared based on the name of the database to which you are connecting. See Versions of Metadata in SQL Engine Reference.
Examples
Example A
This example shows how to connect to a database on a 32-bit operating system with the internal name “SOMEDATA” on a remote server named “ServerMain” using TCP/IP port 1590, trying TCP/IP first then SPX:
Driver={Pervasive ODBC Client Interface}; ServerName=ServerMain.1590;DBQ=SOMEDATA; TransportHint=TCP:SPX;
Example B
This example shows how to connect to an Engine DSN named “mydata” on a remote server named “MyServer” with database security turned on:
Driver={Pervasive ODBC Client Interface}; ServerName=MyServer;ServerDSN=mydata;UID=ajones;PWD=jones52;
Example C
This example shows how to connect to a local database with the internal name “DATA5”:
Driver={Pervasive ODBC Engine Interface};DBQ=DATA5;
Example D
An ODBC client application uses SQLDriverConnect to connect to a server DSN named “mydata” on a remote server named “MyServer” and establishes automatic encoding support:
Driver={Pervasive ODBC Client Interface}; ServerName=MyServer;ServerDSN=mydata;PvTranslate=auto;
Note that the PvTranslate attribute is explicitly stated because a server (an Engine) DSN is specified.
Example E
This example shows how to connect to a local database on a 64-bit operating system with the named database “acctdomestic”:
Driver={Pervasive ODBC Interface};DBQ=acctdomestic;