Link to home
Start Free TrialLog in
Avatar of mitai
mitaiFlag for Canada

asked on

connect to pervasive database with just directory from visual basic

Hi Everyone,

I need the ability to connect to a pervasive database without setting up an odbc connection.  I will have the directory structure of the database etc. but I need to be able to connect using visual basic via odbc, ole, dao whatever.  

Any thoughts on how to do this?

Thanks

Ian
Avatar of Mirtheil
Mirtheil
Flag of United States of America image

The only way to connect to a Pervasive database with just a directory directly would be with the Btrieve API.  If you want to use ODBC, you have to create at least a Pervasive database name.  This can be done in code with DTO.   You will also need DDFs if you using ODBC/OLEDB, etc.  Once you have a database name, you will be able to connect using a connection string like:
sConn = "Provider={Pervasive ODBC Engine Interface};DBQ=myDatabasname"


Why don't you want an ODBC connection?
It needs to be removed from the PostgreSQL zone.  It does not belong there.  
Avatar of mitai

ASKER

I have the ddfs and all the btr files in the directory so that won't be a problem, and I don't mind using odbc if I can create a database name in code.  Do you have a code example of how I would do that in visual basic?

thanks

Ian
ASKER CERTIFIED SOLUTION
Avatar of Mirtheil
Mirtheil
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mitai

ASKER

thanks it looks like that will work, i also found this that seems to work as well (more of a dsnless connection) but the points go to mirtheil

1. local
DRIVER={Pervasive ODBC Client Interface};ServerName=localservername;DBQ=c:\pvsw\demodata

2. remote
DRIVER={Pervasive ODBC Client Interface};ServerName=remoteservername;DBQ=c:\pvsw\demodata



Paths will only work with old versions of PSQL (like PSQL v8).  PSQL v9 and later don't support paths in the DBQ parameter.  Just something to consider.  
Thanks for the points.