0
votes

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!

2

2 Answers

0
votes

A Btrieve error 11 is not related to the connection string. It's related to the DDFs and how they reference the data files. I would think you would get the error 11 even accessing the database through the Pervasive Control Center.
If you are getting an error 11 on connection and not when accessing a specific table, it's probably an invalid database and you need to get new DDFs from Sage. If you open FILE.DDF using the Btrieve Function Executor, you can read the records and my guess is that one of the system tables (table name starts with X$) is missing or incorrect. There should be at least 10 entries:

Xf$Name                Xf$Loc                                                          
====================   ================================================================
X$File                 file.ddf                                                        
X$Field                field.ddf                                                       
X$Index                index.ddf                                                       
X$View                 view.ddf                                                        
X$Proc                 proc.ddf                                                        
X$Relate               relate.ddf                                                      
X$Trigger              trigger.ddf                                                     
X$Attrib               attrib.ddf                                                      
X$Occurs               occurs.ddf                                                      
X$Variant              variant.ddf         
0
votes

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