Board index » delphi » Funny problem with Delphi 5 and ADO

Funny problem with Delphi 5 and ADO

I am using a ADO table to connect to an .mdb file, and using a normal delphi
dataset.

If I add a new record, then post it, then try editing the record I just
added, and then try and post if again I get the following error "The
specified row could not be located for updating.  Some values may have been
changed since it was last read"

Any ideas?

Thanks in advance.

Richard Mace

Richa...@mhsoftware.co.uk

 

Re:Funny problem with Delphi 5 and ADO


On Thu, 27 Jan 2000 22:18:28 -0000, "Richard Mace"

Quote
<Richa...@mhsoftware.co.uk> wrote:
>I am using a ADO table to connect to an .mdb file, and using a normal delphi
>dataset.

What is that "a ADO table"? Is it a Delphi 5 ADOExpress component, like
TADODataSet? Is it a third-party ADO component? Is it some interface to ADO
you created?

The reason I have to ask is that you say you are using *both* an "ADO
table" and a "normal Delphi dataset". The two just do not mix -- the stock
Delphi dataset components use the BDE, not ADO.

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Steve Koterski              "Health nuts are going to feel stupid someday,
Felton, CA                  lying in hospitals dying of nothing."
                                                              -- Redd Foxx

Re:Funny problem with Delphi 5 and ADO


Yes, it is a Delphi TADODataset.

I must admit, I am a "little" puzzled about which components I need to use
to connect to the .mdb file.

Thank you for your time.

Quote
"Steve Koterski" <koter...@NOSPAMgte.net> wrote in message

news:3896eba8.34366633@news.gte.net...
Quote
> On Thu, 27 Jan 2000 22:18:28 -0000, "Richard Mace"
> <Richa...@mhsoftware.co.uk> wrote:

> >I am using a ADO table to connect to an .mdb file, and using a normal
delphi
> >dataset.

> What is that "a ADO table"? Is it a Delphi 5 ADOExpress component, like
> TADODataSet? Is it a third-party ADO component? Is it some interface to
ADO
> you created?

> The reason I have to ask is that you say you are using *both* an "ADO
> table" and a "normal Delphi dataset". The two just do not mix -- the stock
> Delphi dataset components use the BDE, not ADO.

> _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
> Steve Koterski              "Health nuts are going to feel stupid someday,
> Felton, CA                  lying in hospitals dying of nothing."
>                                                               -- Redd Foxx

Re:Funny problem with Delphi 5 and ADO


On Fri, 28 Jan 2000 09:10:15 -0000, "Richard Mace" <Richa...@vip.co.uk>
wrote:

Quote
>Yes, it is a Delphi TADODataset.

>I must admit, I am a "little" puzzled about which components I need to use
>to connect to the .mdb file.

If you are connecting to the database using an ADO provider, you should do
so using the ADO data and dataset components, like TADOConnection and
TADODataSet. If you connect to the database using the BDE (with its native
driver for Microsoft Access or an ODBC driver for Access), use the stock
data and dataset components, like TDatabase and TQuery.

Is your original in a multi-user environment? Or where you getting the
update error when in a single-user environment? The problem suggests update
concurrency that one would experience in a multi-user environment with a
database that uses an optimistic locking scheme.

(Follow-ups to the newsgroup only, please.)

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Steve Koterski              "Health nuts are going to feel stupid someday,
Felton, CA                  lying in hospitals dying of nothing."
                                                              -- Redd Foxx

Re:Funny problem with Delphi 5 and ADO


Hello,

It was a "single user" environment on my development PC.  I can reproduce it
100% of the time.

I am using the components I mentioned, because I can't figure out any other
way of connecting to the data.
If I use a TADODataSource component, it want's it's own datasource which it
appears to want to get from a normal Delphi datasource.

I have learnt one thing.  If the access database is create using Access 97
then the error occurs as I mentioned earlier if I edit a DBEdit field of a
DBCheckbox.  However, if I create the original Access database using Access
2000 (which I thought "may" be my problem, and then try Editing the record
I've just added via the DBEdit it works fine BUT DBCheckbox causes the same
error.

I am now really confused, and am not sure whether it is a combination of
components that I am using that is wrong or if their is a bug in the ADO
components or if their is another bug in the MDac.

I have been looking for articles on the web that describe how to use ADO,
but I can't find one that talks about connecting to an .mdb file.

Thanks in advance.

Richard Mace

Quote
Steve Koterski <koter...@NOSPAMgte.net> wrote in message

news:3893c179.1408135@news.gte.net...
Quote
> On Fri, 28 Jan 2000 09:10:15 -0000, "Richard Mace" <Richa...@vip.co.uk>
> wrote:

> >Yes, it is a Delphi TADODataset.

> >I must admit, I am a "little" puzzled about which components I need to
use
> >to connect to the .mdb file.

> If you are connecting to the database using an ADO provider, you should do
> so using the ADO data and dataset components, like TADOConnection and
> TADODataSet. If you connect to the database using the BDE (with its native
> driver for Microsoft Access or an ODBC driver for Access), use the stock
> data and dataset components, like TDatabase and TQuery.

> Is your original in a multi-user environment? Or where you getting the
> update error when in a single-user environment? The problem suggests
update
> concurrency that one would experience in a multi-user environment with a
> database that uses an optimistic locking scheme.

> (Follow-ups to the newsgroup only, please.)

> _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
> Steve Koterski              "Health nuts are going to feel stupid someday,
> Felton, CA                  lying in hospitals dying of nothing."
>                                                               -- Redd Foxx

Other Threads