Search code examples
.netodbcdsnpervasivepervasive-sql

Establish an ODBC DSN-Less Connection to local Pervasive DB from .NET application


We are developing a .NET application which will be installed on a our clients computer which has installed a Sage 50 (Peachtree) accounting software. Our application will connect to Sage using the Pervasive ODBC driver. We were able to connect to the Sage DB using ODBC driver by configuring a DSN. Unfortunately, this requires our application user to take many steps in order to configure the connection, and we would like to avoid that.

We wish to connect to the Sage DB using ODBC but avoiding setting up a DSN. We have tried connecting to the DB using the below connection string, from our .NET application:

Driver={Pervasive ODBC Engine Interface};dbq=STONEARBORLANDSCAPING;uid=XXXXXXXXX;pwd=XXXXXXXX;

When attempting to connect, the following error is triggered: "ERROR [HY000] [Pervasive][ODBC Client Interface][LNA][Pervasive][ODBC Engine Interface][Data Record Manager]The specified filename is invalid(Btrieve Error 11)\r\nERROR [HY000] [Pervasive][ODBC Client Interface][LNA][Pervasive][ODBC Engine Interface][Data Record Manager]

We have also tried to mess with the DB name, and it did indicate an invalid DB name, so a connection was made. I believe we are missing a parameter in the connection string pointing to a location on the disk. After looking up online and trying various options , I could not get it to work and always came back to the "The specified filename is invalid(Btrieve Error 11)" error.

Would appreciate any tip / direction to follow!


Solution

  • When trying to connect using a non-sample company from Sage, using the same settings, the connection worked.