Upgrading Pervasive 2000i to V9
- From: "Chris Smith" <cjs@xxxxxxxxxxx>
- Date: Wed, 11 Jan 2006 10:37:47 -0000
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
.
- Follow-Ups:
- Re: Upgrading Pervasive 2000i to V9
- From: Bill Bach
- Re: Upgrading Pervasive 2000i to V9
- Prev by Date: Re: ADO server side cursor sloooow
- Next by Date: Btrive time fields in Crystal Report dont display properly
- Previous by thread: BTCPCOM.NLM does not load when server starts
- Next by thread: Re: Upgrading Pervasive 2000i to V9
- Index(es):
Relevant Pages
|