Board index » delphi » Installed D5...error reading tables that worked fine with D4

Installed D5...error reading tables that worked fine with D4

Would like to make an offering to the Delphi Gods, but I'm in Iowa and
we're fresh out of {*word*269}s...so hopefully I can do this on good credit.
Just call me Cain...

    Here's the situation.  I have (had) a working program written in
Delphi 4.  Currently uses the BDE to connect to an Access 97 table
(actually to 5 tables within one database).  Using either my newly
installed version of D5, or my old working copy of D4, I now get an
error stating:

    {tablename}: size mismatch for field '{fieldname of first field in
table}', expecting: 30 (which is right) actual: 60 (always is double)

The program actually throws this up at runtime, and by stepping through
the code I've found that it gets this error on the line that effectively
reads:

    {datamodule name}.{table component}.activate;

If I look at my table in the BDE, I find that all of my "text" fields
have sizes that are doubled.

Anyone have any ideas...?  Has anyone else tried to "migrate" an
existing working DB program from D4 to D5?  Oh, point of note, I did
allow the install to do the ADO "install", but that's the main reason
I'm updating to D5, to use the ADO and try to get around the BDE...

Joel T. Lahey
lah...@ncs.com

 

Re:Installed D5...error reading tables that worked fine with D4


D5 beta installs MDAC2.1 during its install for the ADO stuff.  Part of that is
installing an updated ODBC driver for Access.  There is a bug in the ODBC driver
and it returns double the size (IIRC, this is off the top of my head).  You need
to goto MS's site and download a newer copy of MDAC, I beleive it is fixed in
that one but not positive.  Sorry I can't be of more help on this one.  Goto
http://www.microsoft.com/data/download.htm and get the latest release of 2.1.

Unfortunately the BDE is ODBC2.5 compliant and the ODBC drivers in MDAC2.1 are
3.0 (or maybe 3.5 ?) so this might not fix it.  If this does fix it how about
dopping a note saying so.  This is going to be a common question I beleive and
it would be nice to make sure this fixes it.

Quote
Joel Lahey wrote:

> Would like to make an offering to the Delphi Gods, but I'm in Iowa and
> we're fresh out of {*word*269}s...so hopefully I can do this on good credit.
> Just call me Cain...

>     Here's the situation.  I have (had) a working program written in
> Delphi 4.  Currently uses the BDE to connect to an Access 97 table
> (actually to 5 tables within one database).  Using either my newly
> installed version of D5, or my old working copy of D4, I now get an
> error stating:

>     {tablename}: size mismatch for field '{fieldname of first field in
> table}', expecting: 30 (which is right) actual: 60 (always is double)

> The program actually throws this up at runtime, and by stepping through
> the code I've found that it gets this error on the line that effectively
> reads:

>     {datamodule name}.{table component}.activate;

> If I look at my table in the BDE, I find that all of my "text" fields
> have sizes that are doubled.

> Anyone have any ideas...?  Has anyone else tried to "migrate" an
> existing working DB program from D4 to D5?  Oh, point of note, I did
> allow the install to do the ADO "install", but that's the main reason
> I'm updating to D5, to use the ADO and try to get around the BDE...

> Joel T. Lahey
> lah...@ncs.com

--
Jeff Overcash (TeamB)
      (Please do not email me directly unless  asked. Thank You)
And so I patrol in the valley of the shadow of the tricolor
I must fear evil. For I am but mortal and mortals can only die.
Asking questions, pleading answers from the nameless
faceless watchers that stalk the carpetted  corridors of Whitehall.
             (Fish)
--

Re:Installed D5...error reading tables that worked fine with D4


Jeff,
    I went to the site you listed, and downloaded the latest MDAC2.1 drivers (a 6.7
meg executible named "mdac_typ.exe" which is pointed to by the link "MDAC
2.1.2.4202.3 (GA), installed them, and tried it.

Result:= no change;

Not knowing much about ODBC, I'm at an impass.  I've removed the install of D5 (and
D4, and D3), reinstalled D4 and still got the same thing.

Quote
"Jeff Overcash (TeamB)" wrote:
> D5 beta installs MDAC2.1 during its install for the ADO stuff.  Part of that is
> installing an updated ODBC driver for Access.  There is a bug in the ODBC driver
> and it returns double the size (IIRC, this is off the top of my head).  You need
> to goto MS's site and download a newer copy of MDAC, I beleive it is fixed in
> that one but not positive.  Sorry I can't be of more help on this one.  Goto
> http://www.microsoft.com/data/download.htm and get the latest release of 2.1.

> Unfortunately the BDE is ODBC2.5 compliant and the ODBC drivers in MDAC2.1 are
> 3.0 (or maybe 3.5 ?) so this might not fix it.  If this does fix it how about
> dopping a note saying so.  This is going to be a common question I beleive and
> it would be nice to make sure this fixes it.

> Joel Lahey wrote:

> > Would like to make an offering to the Delphi Gods, but I'm in Iowa and
> > we're fresh out of {*word*269}s...so hopefully I can do this on good credit.
> > Just call me Cain...

> >     Here's the situation.  I have (had) a working program written in
> > Delphi 4.  Currently uses the BDE to connect to an Access 97 table
> > (actually to 5 tables within one database).  Using either my newly
> > installed version of D5, or my old working copy of D4, I now get an
> > error stating:

> >     {tablename}: size mismatch for field '{fieldname of first field in
> > table}', expecting: 30 (which is right) actual: 60 (always is double)

> > The program actually throws this up at runtime, and by stepping through
> > the code I've found that it gets this error on the line that effectively
> > reads:

> >     {datamodule name}.{table component}.activate;

> > If I look at my table in the BDE, I find that all of my "text" fields
> > have sizes that are doubled.

> > Anyone have any ideas...?  Has anyone else tried to "migrate" an
> > existing working DB program from D4 to D5?  Oh, point of note, I did
> > allow the install to do the ADO "install", but that's the main reason
> > I'm updating to D5, to use the ADO and try to get around the BDE...

> > Joel T. Lahey
> > lah...@ncs.com

> --
> Jeff Overcash (TeamB)
>       (Please do not email me directly unless  asked. Thank You)
> And so I patrol in the valley of the shadow of the tricolor
> I must fear evil. For I am but mortal and mortals can only die.
> Asking questions, pleading answers from the nameless
> faceless watchers that stalk the carpetted  corridors of Whitehall.
>              (Fish)
> --

Re:Installed D5...error reading tables that worked fine with D4


Sorry for the double post, I was trying to edit something and hit {insert mystery key
here} and it suddenly sent my post before I was done...

To finish my question...
    a) is that the right set of drivers that you were referring to?
    b) is there a *easy* (besides format c:\) to remove the drivers and re-install them

    c) is there a way to remove the BDE in it's entirety and re-install it pointing to
the working old drivers?
    d) I as a developer have little hope getting this resolved via normal channels with
Microsoft, but Borland/Inprise may...
    e) any other suggestions?

My last thing I can think of would be to remove Access 97, and try to reinstall it, but
I doubt that would help either.

Help, please...

    Joel T. Lahey
    lah...@ncs.com

Quote
Joel Lahey wrote:
> Jeff,
>     I went to the site you listed, and downloaded the latest MDAC2.1 drivers (a 6.7
> meg executible named "mdac_typ.exe" which is pointed to by the link "MDAC
> 2.1.2.4202.3 (GA), installed them, and tried it.

> Result:= no change;

> Not knowing much about ODBC, I'm at an impass.  I've removed the install of D5 (and
> D4, and D3), reinstalled D4 and still got the same thing.

> "Jeff Overcash (TeamB)" wrote:

> > D5 beta installs MDAC2.1 during its install for the ADO stuff.  Part of that is
> > installing an updated ODBC driver for Access.  There is a bug in the ODBC driver
> > and it returns double the size (IIRC, this is off the top of my head).  You need
> > to goto MS's site and download a newer copy of MDAC, I beleive it is fixed in
> > that one but not positive.  Sorry I can't be of more help on this one.  Goto
> > http://www.microsoft.com/data/download.htm and get the latest release of 2.1.

> > Unfortunately the BDE is ODBC2.5 compliant and the ODBC drivers in MDAC2.1 are
> > 3.0 (or maybe 3.5 ?) so this might not fix it.  If this does fix it how about
> > dopping a note saying so.  This is going to be a common question I beleive and
> > it would be nice to make sure this fixes it.

> > Joel Lahey wrote:

> > > Would like to make an offering to the Delphi Gods, but I'm in Iowa and
> > > we're fresh out of {*word*269}s...so hopefully I can do this on good credit.
> > > Just call me Cain...

> > >     Here's the situation.  I have (had) a working program written in
> > > Delphi 4.  Currently uses the BDE to connect to an Access 97 table
> > > (actually to 5 tables within one database).  Using either my newly
> > > installed version of D5, or my old working copy of D4, I now get an
> > > error stating:

> > >     {tablename}: size mismatch for field '{fieldname of first field in
> > > table}', expecting: 30 (which is right) actual: 60 (always is double)

> > > The program actually throws this up at runtime, and by stepping through
> > > the code I've found that it gets this error on the line that effectively
> > > reads:

> > >     {datamodule name}.{table component}.activate;

> > > If I look at my table in the BDE, I find that all of my "text" fields
> > > have sizes that are doubled.

> > > Anyone have any ideas...?  Has anyone else tried to "migrate" an
> > > existing working DB program from D4 to D5?  Oh, point of note, I did
> > > allow the install to do the ADO "install", but that's the main reason
> > > I'm updating to D5, to use the ADO and try to get around the BDE...

> > > Joel T. Lahey
> > > lah...@ncs.com

> > --
> > Jeff Overcash (TeamB)
> >       (Please do not email me directly unless  asked. Thank You)
> > And so I patrol in the valley of the shadow of the tricolor
> > I must fear evil. For I am but mortal and mortals can only die.
> > Asking questions, pleading answers from the nameless
> > faceless watchers that stalk the carpetted  corridors of Whitehall.
> >              (Fish)
> > --

Re:Installed D5...error reading tables that worked fine with D4


Quote
Joel Lahey wrote:

> To finish my question...
>     a) is that the right set of drivers that you were referring to?

Yes those were them

Quote
>     b) is there a *easy* (besides format c:\) to remove the drivers and re-install them

Try uninstalling MDAC if that is an uninstall option.  Hopefully that will
revert back to the previous ODBC drivers.

Quote
>     c) is there a way to remove the BDE in it's entirety and re-install it pointing to
> the working old drivers?

It's not the BDE, it is the new ODBC drivers that MDAC installs that is the
problem.  The BDE does not come with any MSACCESS ODBC drivers.

Quote
>     d) I as a developer have little hope getting this resolved via normal channels with
> Microsoft, but Borland/Inprise may...
>     e) any other suggestions?

Unfortunately I do not work with ODBC, so I can't tell you how to install an
earlier version of an ODBC driver over a later one.  That is what you need to go
back to.

Quote

> My last thing I can think of would be to remove Access 97, and try to reinstall it, but
> I doubt that would help either.

That might, it depends on how smart the installer is and if it will just install
its ODBC drivers over any already installed even if they are newer.

Quote
> Help, please...

>     Joel T. Lahey
>     lah...@ncs.com

--
Jeff Overcash (TeamB)
      (Please do not email me directly unless  asked. Thank You)
And so I patrol in the valley of the shadow of the tricolor
I must fear evil. For I am but mortal and mortals can only die.
Asking questions, pleading answers from the nameless
faceless watchers that stalk the carpetted  corridors of Whitehall.
             (Fish)
--

Re:Installed D5...error reading tables that worked fine with D4


Hi Joel,

Thank you for posting this information on the newsgroup.  I will have to
tell you at this point that D5 Trial is still a Field Test build and we are
not able to guarentee successful migrations at this point.  I have had only
success with the ADO components , but keep plugging away and you may find
something wrong with it (in which case, please submit a bug to us on our
website).  In the future, these questions would be more quickly answered in
one of the DB discussion groups where all the gurus hang out.

R/S Aaron Rhodes
Delphi Technical Support

Re:Installed D5...error reading tables that worked fine with D4


This was just sent out on the Delphi Tech Alert and it is your 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."

So it look like going back to an older ODBC driver is the only solution for now
if you wish to continue to use ODBC.  Wish I had a better solution for you.

Quote
Joel Lahey wrote:

--
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)
--

Other Threads