help needed on odbcdbe problem

Xbase++ 2.0 Build 554 or later
Post Reply
Message
Author
johnlau
Posts: 4
Joined: Thu Mar 11, 2010 1:31 am

help needed on odbcdbe problem

#1 Post by johnlau »

I have an application under Xbase 1.8 (ver 306) + eXPress 232, using ODBCDBE to connect to an MSSQL server. After many years of working, I now need to port it to Xbase 2.0 and run it under Win10, but encountering problems.

The application has been re-generated under Xbase 2.0 (ver 1023) + eXPress 264 and appears to run normally. However, it fails when tables with memo fields are updated, with error 'Error writing a file' and 'Function Sequence Error' at DbRUnlock, or DbCommit, or CLOSE.

Has anyone run into similar problems? Any work around available?

The attached test program, adapted from a sample program, demonstrates the problem. The same test program runs in the Xbase 1.8 environment (win 7 + ODBCDBE connecting to an MS SQL server) but fails under the Xbase 2.0 environment.

Regards,
John Lau
Attachments
odbctest.zip
(5.67 KiB) Downloaded 720 times

johnlau
Posts: 4
Joined: Thu Mar 11, 2010 1:31 am

Re: help needed on odbcdbe problem

#2 Post by johnlau »

Problem solved !!! after the following changes were made:

2 important rules to follow using ODBCDBE when memo fields are involved (at least on the ODBC drivers and the MS SQL server I used):

1. When reading in a row, all fields must be accessed once in field no. order. Then further accesses to fields may be in any order.
2. When updating a row, all fields – whether update needed or not, must be written (even just with original values) once in field no. order.

Failure to observe the above will lead to ODBC errors.

It would be useful if all these (and possibly other) peculiar behaviors of ODBCDBE are written in the ODBC help file. That would save people a lot of time.

Thank you for your attention.

Post Reply