Board index » delphi » String problems with D4, Access 97, MDAC 2 and BDE 5.x

String problems with D4, Access 97, MDAC 2 and BDE 5.x

After installing MDAC 2 (Microsoft Data Access Component)  the text fields
from MsAccess comes up double their size through BDE.  I have tried both BDE
5.1 and 5.10.
With late binding my App doesn't crash though, only with early binded
queries and tables.
It work correctly with ODBCExpress.

Any suggestion ??

 

Re:String problems with D4, Access 97, MDAC 2 and BDE 5.x


Quote
>After installing MDAC 2 (Microsoft Data Access Component)  the text fields
>from MsAccess comes up double their size through BDE.  I have tried both BDE
>5.1 and 5.10.
>With late binding my App doesn't crash though, only with early binded
>queries and tables.
>It work correctly with ODBCExpress.

This is a known problem.   Borland has issued the following tech alert on the
problem

........
Product: Delphi/BDE
Version: 4.0/5.0
Description: Problems with Newest MS Access driver
Symptoms: "Record Key Deleted" or "Size Mismatch"    error.

Steps to Reproduce:
Installing the newest version of the MS Access
ODBC driver, version 4.00.3711.08, can cause these
errors. This new version comes with Windows 98
release 2, Access 2000, the Microsoft Data Access
Components (MDAC) and perhaps other sources.
The error is happening because Microsoft has made a
change in the driver regarding the length of fields,
and now the BDE is expecting the field length to be
twice as long as it actually is.  For example, a
field length may be 30 in the Access database, but
the BDE reports it to be 60.

Microsoft documentation specifies that the length,
in bytes, of data transferred (the buffer size) on
an SQLGetData, SQLFetch, or SQLFetchScroll operation
shall be the same as the COLUMN_SIZE for binary
and character data. This is not in fact the case
with the new driver; the buffer is actually larger
than COLUMN_SIZE.

The BDE does not look at COLUMN_SIZE because for
numerical data it may not be the same as the
buffer size. Instead the BDE looks at the buffer
size which now has the erroneous value.

Workarounds:
1. Use the Delphi native driver instead of ODBC.
2. Use an older version of the Access ODBC driver.
3. In Delphi 5: Use ADO components to access the
   MS JET database engine or to access ODBC drivers.
   Accessing the ODBC driver this way is not
   optimal, but does bypass the BDE which will
   avoid the problem.
----------------------------
--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Other Threads