Board index » delphi » Access 2000 and BDE

Access 2000 and BDE

How can I connect to an Access2000 database via BDE?

-Sejer

 

Re:Access 2000 and BDE


You will need to go with ODBC and not DAO.  This is from one of the Delphi
Tech-alerts from July

"We have heard cases of people having trouble
using Access 2000 with the BDE. It should be
noted that the BDE's native Access driver (and
Access 97) use DAO while Access 2000 uses ADO.
Attempting to open an Access 2000 table with the
BDE's native driver will give an error.  ODBC
seems to work fine with Access 2000 so this is
the recommended way to go if you're upgrading to
Access 2000."

Also concerning ODBC there is possible a problem depending on your version.  

"nstalling 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."

Taking both of these in conjunction means that you are best off using the
Access97 ODBC driver if you have problems with the Access2000 ODBC driver.

Quote
Jens Sejer Johansen wrote:

> How can I connect to an Access2000 database via BDE?

> -Sejer

--
Jeff Overcash (TeamB)
      (Please do not email me directly unless  asked. Thank You)
The mist crawls from the c{*word*7}like some primordial phantom of romance
To curl, under the cascade of neon pollen.  While I sit tied to the phone
like some expectant father, your carnation will rot in a vase.
             (Fish)
--

Re:Access 2000 and BDE


Hello,

I installed MS Access 2000 and some things happened. First (what was almost
expected), it didn't work with my Delphi application. The main perceptible
thing was that it doubled the size of the string fields. As it seems as an
ODBC problem, does anyone of you know what can I do.

Just for your information. I unistalled Office 2000 and tried to re-install
Access 97 but it does not work... There's a message like: You don't have the
license to run this application (BUT I HAVE!).

GUS

Re:Access 2000 and BDE


You will need to go with ODBC and not DAO.  This is from one of the Delphi
Tech-alerts from July

"We have heard cases of people having trouble
using Access 2000 with the BDE. It should be
noted that the BDE's native Access driver (and
Access 97) use DAO while Access 2000 uses ADO.
Attempting to open an Access 2000 table with the
BDE's native driver will give an error.  ODBC
seems to work fine with Access 2000 so this is
the recommended way to go if you're upgrading to
Access 2000."

Also concerning ODBC there is possible a problem depending on your version.  

"nstalling 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."

Taking both of these in conjunction means that you are best off using the
Access97 ODBC driver if you have problems with the Access2000 ODBC driver.

Quote
Gustavo Laet Gomes wrote:

> Hello,

> I installed MS Access 2000 and some things happened. First (what was almost
> expected), it didn't work with my Delphi application. The main perceptible
> thing was that it doubled the size of the string fields. As it seems as an
> ODBC problem, does anyone of you know what can I do.

> Just for your information. I unistalled Office 2000 and tried to re-install
> Access 97 but it does not work... There's a message like: You don't have the
> license to run this application (BUT I HAVE!).

> GUS

--
Jeff Overcash (TeamB)
      (Please do not email me directly unless  asked. Thank You)
The mist crawls from the c{*word*7}like some primordial phantom of romance
To curl, under the cascade of neon pollen.  While I sit tied to the phone
like some expectant father, your carnation will rot in a vase.
             (Fish)
--

Re:Access 2000 and BDE


Quote
>I installed MS Access 2000 and some things happened. First (what was almost
>expected), it didn't work with my Delphi application. The main perceptible
>thing was that it doubled the size of the string fields. As it seems as an
>ODBC problem, does anyone of you know what can I do.

At this time the only way is to go back to an older Access ODBC driver than what
Office 2000 has installed for you

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Other Threads