Upgrading Pervasive 2000i to V9



Hi,

I am in the process of testing our applications that currently use PSQL2000i
on PSQL9. The applications that use the Btrieve API work (as you would
expect) however I am having difficulties with applications that access the
data using OLEDB.

Code currently working on PSQL2000i

Function cstest()
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Const connstring As String = "Provider=PervasiveOLEDB;Data
Source=\\server\pathtoddffolder;Persist Security Info=False"
Set cnn = New ADODB.Connection
cnn.Open connstring
Set rst = New ADODB.Recordset
rst.Open "SELECT * FROM INVOICE_HEADERS WHERE Customer_Name='Customer'",cnn,
adOpenDynamic, adLockReadOnly
rst.MoveFirst
Do
MsgBox rst!Customer_Name
rst.MoveNext
Loop Until rst.EOF = True
rst.Close
cnn.Close
Set cnn = Nothing
End Function

However, to get the same results on PSQL9 I have to ammend the code to

Function cstest()
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Const connstring As String = "Provider=PervasiveOLEDB.9.11;Data
Source=DatabaseName;Location=Server;Persist Security Info=False"
Set cnn = New ADODB.Connection
cnn.Open connstring
Set rst = New ADODB.Recordset
custname = "Customer"
custname=custname& Space((50 - Len(custname)))
rst.Open "SELECT * FROM INVOICE_HEADERS WHERE Customer_Name='" & custname &
"'", cnn, adOpenDynamic, adLockReadOnly
rst.MoveFirst
Do
MsgBox rst!Customer_Name
rst.MoveNext
Loop Until rst.EOF = True
rst.Close
cnn.Close
Set cnn = Nothing
End Function

Changing the connection string is easy enough but I have to space out the
field used in in the WHERE clause to match the field size in the table
structure.

This spacing out is also necessary when I try and execute a SQL statement in
the PCC.

Is there any option, registry modification etc that will allow execution of
the SQL statements without the modification of the variable used in the
WHERE clause.

Many thanks for your anticipated help.

Chris


.



Relevant Pages

  • Re: Upgrading Pervasive 2000i to V9
    ... The applications that use the Btrieve API work ... > Dim cnn As ADODB.Connection ... > Dim rst As ADODB.Recordset ... > Set cnn = New ADODB.Connection ...
    (comp.databases.btrieve)
  • Re: Upgrading Pervasive 2000i to V9
    ... I have confirmed this too by returning data in VARCHAR fields and then ... >> Dim cnn As ADODB.Connection ... >> Dim rst As ADODB.Recordset ... >> Set cnn = New ADODB.Connection ...
    (comp.databases.btrieve)
  • Re: Looping through a table for a form
    ... Sub ADOTest() ... Dim cnn as New ADODB.Connection ... Dim rst as New ADODB.Recordset ... Set cnn = CurrentProject.Connection 'N.B. ...
    (microsoft.public.access.formscoding)
  • Re: Update Database (mdb) script
    ... Dim cnn, dbPath, strSQL ... Set cnn = CreateObject ... "Cadstillo" wrote: ...
    (microsoft.public.scripting.vbscript)
  • .AddItem method not working
    ... box named lboConnections with two columns named Compter Name, ... Dim cnn As ADODB.Connection ... Dim rst As ADODB.Recordset ... Set cnn = CurrentProject.Connection ...
    (microsoft.public.access.formscoding)