Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble Accessing pervasive in VB6 1

Status
Not open for further replies.

smeyer56

IS-IT--Management
Oct 16, 2002
206
US
I have tried to create a connection in VB6 to Pervasive 2000 but seem to have problems doing it. I have and can create it if I set up ODBC connections on each workstation on the Wan were this application will run but i am trying to set this up without doing that. Is it possible?
 
That was it! Thanks for the excellent link too.

Steve
 
New problem. I can access the DB using this method and the connection says okay, but when I try to access the tables they say the tables are not found.

I wonder if this is because the DDF's are in one folder and not with the data files.

Any ideas?
 
That could be, I have never had the data files in a different folder than the DDF Files.

Can you set the database up properly in the PCC (Pervasice Control Center)? What is the exact error message? Have you double checked for typos? Post the opffending code and we will have a look.

zemp
 
It works in the PCC but that is using the DSN I created on the server not the data files directly.

"Runtime error '-2147217865(80040e37)'
Table does not exist"

is the error.

Here is the code
Private Sub Form_Load()
cn.ConnectionString = "Provider=PervasiveOLEDB;Data Source=\\server2\synshare\syn\willow"
cn.CursorLocation = adUseServer
cn.Open
rs.Open "ps_hdr", cn, adOpenDynamic, adLockBatchOptimistic, adCmdTableDirect

cn.Close
End Sub

If there was a way to use the DSN on the server to run this as PCC does instead of installing the DSN on each workstation that would be great too.
 
I just reread my previous posts and may have mislead you. The DDF's are in the willow folder above, as well as a different folder I use for setting up the DSN on the server, but the actual data files are in the willow folder in folders of their own.
ie:
DDF's
..\syn\willow\field.ddf
..\syn\willow\file.ddf
Datafiles
..\syn\willow\psdata\pshdrf.dat
..\syn\willow\psdata\pslinf.dat

but in the ODBC, the tables are listed as ps_hdr and ps_lin

 
Got it. Needed the SERVERNAME in there. rewrote it as:
Dim myData As New ADODB.Recordset
myData.CursorLocation = adUseServer
myData.Open "PS_HDR", "Driver={Pervasive ODBC Client Interface};ServerName=SERVER2;dbq=@WCComplete", adOpenDynamic, adLockOptimistic, adCmdTableDirect
myData.Close

thanks zemp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top