Board index » delphi » Access 97 update error

Access 97 update error

I have a Delphi 5 front end connected to an Access 97 back-end using ODBC
and I'm having problems posting existing records (dsEdit) on the details
portion of a master-detail form.
It works fine when a single record is present on the details, but if there's
more than one record on the details, then I get the error: "Couldn't perform
the edit because another user changed the record".
The application is standalone and is not being shared or used on a network.

Thanks,
Rafael

 

Re:Access 97 update error


Quote
>I have a Delphi 5 front end connected to an Access 97 back-end using ODBC
>and I'm having problems posting existing records (dsEdit) on the details
>portion of a master-detail form.
>It works fine when a single record is present on the details, but if there's
>more than one record on the details, then I get the error: "Couldn't perform
>the edit because another user changed the record".

Is this after you have inserted a new record and you are trying to modify it
before requerying the detail?  This can happen if you have default values set in
the database and your query is using all the field values in the record to
locate the record in the database to make a change.
You can use the Update Criteria property to change the behavior to use just the
key values.
ADODataSet1.Properties['Update Criteria'].value :=adCriteriaKey;

set this property in the BeforeUpdate event.

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

Re:Access 97 update error


Mr. Bushay,

Changing the update mode to key only did solve the problem.

Thanks a lot,

Rafael

"Brian Bushay TeamB" <BBus...@Nmpls.com> wrote in message
news:9e85augkqn3oie23b9d8624bfslrhmtaaa@4ax.com...

Quote

> >I have a Delphi 5 front end connected to an Access 97 back-end using ODBC
> >and I'm having problems posting existing records (dsEdit) on the details
> >portion of a master-detail form.
> >It works fine when a single record is present on the details, but if
there's
> >more than one record on the details, then I get the error: "Couldn't
perform
> >the edit because another user changed the record".

> Is this after you have inserted a new record and you are trying to modify
it
> before requerying the detail?  This can happen if you have default values
set in
> the database and your query is using all the field values in the record to
> locate the record in the database to make a change.
> You can use the Update Criteria property to change the behavior to use
just the
> key values.
> ADODataSet1.Properties['Update Criteria'].value :=adCriteriaKey;

> set this property in the BeforeUpdate event.

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

Other Threads