MS Access to Pervasive SQL DSN-Less connection

NOTE: The term, "DSN-less connection" is not accurate when using Pervasive.SQL relational access, since a DSN must be defined on the server using the Pervasive ODBC Engine Interface.

In the Example below TDATA System DSN Must exist on the server.

If InStr(1, tblDef.Connect, "ODBC") > 0 Then
 'SQL Pervasive Database
 strSQLConnectionString = GetSQLConnectionString()
 'tblDef.Connect = strSQLConnectionString
 tblDef.Connect = "ODBC;driver={Pervasive ODBC Client Interface};ServerName=10.1.0.16;ServerDSN=TDATA;" & ";TABLE=" & tblDef.Name
 tblDef.RefreshLink
End If

 

More information is here

http://support.pervasive.com/t5/tkb/articleprintpage/tkb-id/Database_KnowledgeBase/article-id/804

Solution Notes

NOTE: The term, "DSN-less connection" is not accurate when using Pervasive.SQL relational access, since a DSN must be defined on the server using the Pervasive ODBC Engine Interface.

The following connection strings can be used to access Pervasive ODBC Engine DSNs programmatically:

1) Setup a DSN on the client machine using the Pervasive ODBC Client Interface. Connection String can be "DSN=myDSN;", assuming the client side DSN is named as myDSN.

2) Without setting up a DSN on the client machine:
Connection String can be "driver={Pervasive ODBC Client Interface};ServerName=myServer;ServerDSN=myDSN;" or
Connection String can be "driver={Pervasive ODBC Client Interface};ServerName=myServer;DBQ=dbName;"

NOTE: Here, myServer is the server name or IP address; myDSN is the server side DSN using the Pervasive ODBC Engine Interface; dbName is the database which is used to define the server side DSN

 

Add comment

Loading