Board index » off-topic » CachedUpdates : ApplyUpdates failed

CachedUpdates : ApplyUpdates failed


2006-09-13 06:10:42 PM
off-topic19
Hi all !
I'm using CachedUpdates & UpdateSQL with BDE 5 and Delphi 7.
In the following case, i've systematicaly an error.
"table" is a TTable on a DBase IV file.
"database" is a TDatabase conneted to the directory containing the "table"
DBase file.
table.Open;
// Insert a record in a grid (using cachedupdates)
database.StartTransaction
table.ApplyUpdates
database.commit
table.CommitUpdates
// delete the previous inserted entry using cached updates in a grid
database.StartTransaction
table.ApplyUpdates =>raise an exception EDatabaseError with message "Update
Failed" (in french "Echec de la mise ?jour")
The "table" UpdateSQL insert statement is the following:
DELETE FROM MYTABLE WHERE (ID = :OLD_ID) AND (NAME = :OLD_NAME)
It seems to be a BDE bug. I'm looking for a solution, or a way to turn
around it.
Thanks a lot.
 
 

Re:CachedUpdates : ApplyUpdates failed

"GrosNo" < XXXX@XXXXX.COM >a écrit dans le message de news:
XXXX@XXXXX.COM ...
Quote
Hi all !

I'm using CachedUpdates & UpdateSQL with BDE 5 and Delphi 7.
In the following case, i've systematicaly an error.

"table" is a TTable on a DBase IV file.
"database" is a TDatabase conneted to the directory containing the "table"
DBase file.

table.Open;
// Insert a record in a grid (using cachedupdates)
database.StartTransaction
table.ApplyUpdates
database.commit
table.CommitUpdates
// delete the previous inserted entry using cached updates in a grid
database.StartTransaction
table.ApplyUpdates =>raise an exception EDatabaseError with message
"Update Failed" (in french "Echec de la mise ?jour")

The "table" UpdateSQL insert statement is the following:
DELETE FROM MYTABLE WHERE (ID = :OLD_ID) AND (NAME = :OLD_NAME)

It seems to be a BDE bug. I'm looking for a solution, or a way to turn
around it.

Thanks a lot.
If my explanations were bad, I've found with google an identical problem
described by a guy in 2001 in "borland.public.delphi.database.sqlservers"
group !
He said:
In my project I use "CahedUpdates" query
(CashedUpdates=True, RequestLive=False, UpdateObject=....: TUpdateSQL)
I have a problem when I delete a record in following way:
1) I add a new record (Insert...FindField(...):='...'...Post)
2)I call ApplyUpdates (no matter whether TQuery.ApplyUpdates or
TDataBase.ApplyUpdates)
3)I delete the record I'VE JUST ADDED
4)I call ApplyUpdates
Here I get an exception EDataBaseError with message: "Update failed".
This exception DOESN'T occur if:
- I don't perform the step 2 (ApplyUpdates)
- I delete another record
- I close and open this TQuery before step 3 (deleting)
But I can't find a solution ! Help please !
Thanks a lot
 

Re:CachedUpdates : ApplyUpdates failed

"GrosNo" < XXXX@XXXXX.COM >a écrit dans le message de news:
4508041d$ XXXX@XXXXX.COM ...
Quote
"GrosNo" < XXXX@XXXXX.COM >a écrit dans le message de news:
XXXX@XXXXX.COM ...
>Hi all !
>
>I'm using CachedUpdates & UpdateSQL with BDE 5 and Delphi 7.
>In the following case, i've systematicaly an error.
>
>"table" is a TTable on a DBase IV file.
>"database" is a TDatabase conneted to the directory containing the
>"table" DBase file.
>
>table.Open;
>// Insert a record in a grid (using cachedupdates)
>database.StartTransaction
>table.ApplyUpdates
>database.commit
>table.CommitUpdates
>// delete the previous inserted entry using cached updates in a grid
>database.StartTransaction
>table.ApplyUpdates =>raise an exception EDatabaseError with message
>"Update Failed" (in french "Echec de la mise ?jour")
>
>The "table" UpdateSQL insert statement is the following:
>DELETE FROM MYTABLE WHERE (ID = :OLD_ID) AND (NAME = :OLD_NAME)
>
>It seems to be a BDE bug. I'm looking for a solution, or a way to turn
>around it.
>
>Thanks a lot.

If my explanations were bad, I've found with google an identical problem
described by a guy in 2001 in "borland.public.delphi.database.sqlservers"
group !
He said:

In my project I use "CahedUpdates" query
(CashedUpdates=True, RequestLive=False, UpdateObject=....: TUpdateSQL)
I have a problem when I delete a record in following way:

1) I add a new record (Insert...FindField(...):='...'...Post)
2)I call ApplyUpdates (no matter whether TQuery.ApplyUpdates or
TDataBase.ApplyUpdates)
3)I delete the record I'VE JUST ADDED
4)I call ApplyUpdates
Here I get an exception EDataBaseError with message: "Update failed".

This exception DOESN'T occur if:
- I don't perform the step 2 (ApplyUpdates)
- I delete another record
- I close and open this TQuery before step 3 (deleting)

But I can't find a solution ! Help please !
Thanks a lot
Please help !
Thanks a lot.
 

{smallsort}