I have been trying to connect and read data from a Pervasive v8 database.
I have created a DSN which tests successfully.
Initially, I was creating a VB script to read the database and transfer the data to another database.
The connection opens successfully both using a DSN or connection string.
When the code gets to opening a recordset. I get the following error.
Run-time error -2147457259 (800004005)
[Microsoft][ODBC Driver Manager] Data source name too long
Function Retrieve_Vendor_Data()
Dim pCnn, pRst, Cnn, Rst
Set pCnn = CreateObject("ADODB.Connection")
Set pRst = CreateObject("ADODB.Connection")
Const adStateClosed = 0
Const adOpenStatic = 3
Const adUseClient = 3
Const adLockBatchOptimistic = 4
Dim bVendorExists
Dim iNextID
'Retrieve Data from Vendor Table
If pCnn.State = adStateClosed Then
'pCnn.Open "DSN=APACC;"
pCnn.Open "Provider=PervasiveOLEDB;Data Source=U:\Vol_1\ACTW\APDSN;"
End If
[red]
pRst.Open "SELECT * FROM Vendors WHERE number like '[A-Z]%' order by number", pCnn
Point of error
[/color]
Connection Strings that are returned
pCnn.Open "DSN=APACC;"
Provider=MSDASQL.1;Extended Properties="DSN=APACC;ServerName=192.168.1.112.1583;
ServerDSN=apacc;ArrayFetchOn=1;ArrayBufferSize=8;
TransportHint=TCP;DecimalSymbol=.;
ClientVersion=8.70.014.000;CodePageConvert=1252;
AutoDoubleQuote=0;"
pCnn.Open "Provider=PervasiveOLEDB;Data Source=U:\Vol_1\ACTW\APDSN;"
Provider=PervasiveOLEDB.8.70;Data Source=apacc;Location=192.168.1.112;Cache Authentication=False;Encrypt Password=False;Mask Password=False;Persist Encrypted=False;Persist Security Info=False;Impersonation Level=Anonymous;Mode=ReadWrite;Protection Level=None;Auto Translate=False;Port=1583;Pessimistic Read Lock=False;CommandOnly=False;DirectOnly=False;
LocalTCP=False
Any Ideas?
I have created a DSN which tests successfully.
Initially, I was creating a VB script to read the database and transfer the data to another database.
The connection opens successfully both using a DSN or connection string.
When the code gets to opening a recordset. I get the following error.
Run-time error -2147457259 (800004005)
[Microsoft][ODBC Driver Manager] Data source name too long
Function Retrieve_Vendor_Data()
Dim pCnn, pRst, Cnn, Rst
Set pCnn = CreateObject("ADODB.Connection")
Set pRst = CreateObject("ADODB.Connection")
Const adStateClosed = 0
Const adOpenStatic = 3
Const adUseClient = 3
Const adLockBatchOptimistic = 4
Dim bVendorExists
Dim iNextID
'Retrieve Data from Vendor Table
If pCnn.State = adStateClosed Then
'pCnn.Open "DSN=APACC;"
pCnn.Open "Provider=PervasiveOLEDB;Data Source=U:\Vol_1\ACTW\APDSN;"
End If
[red]
pRst.Open "SELECT * FROM Vendors WHERE number like '[A-Z]%' order by number", pCnn
Point of error
[/color]
Connection Strings that are returned
pCnn.Open "DSN=APACC;"
Provider=MSDASQL.1;Extended Properties="DSN=APACC;ServerName=192.168.1.112.1583;
ServerDSN=apacc;ArrayFetchOn=1;ArrayBufferSize=8;
TransportHint=TCP;DecimalSymbol=.;
ClientVersion=8.70.014.000;CodePageConvert=1252;
AutoDoubleQuote=0;"
pCnn.Open "Provider=PervasiveOLEDB;Data Source=U:\Vol_1\ACTW\APDSN;"
Provider=PervasiveOLEDB.8.70;Data Source=apacc;Location=192.168.1.112;Cache Authentication=False;Encrypt Password=False;Mask Password=False;Persist Encrypted=False;Persist Security Info=False;Impersonation Level=Anonymous;Mode=ReadWrite;Protection Level=None;Auto Translate=False;Port=1583;Pessimistic Read Lock=False;CommandOnly=False;DirectOnly=False;
LocalTCP=False
Any Ideas?