Home
Top.Mail.Ru Yandeks.Metrika
Forum: "Bases";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Down

problem with deleting records Find similar branches


victor   (2001-12-06 09:46) [0]

I use Query with CashedUpdates: = True; and updateSQL
if I add a new entry, then for some reason I delete it, then the UpdateFailed replica comes out
but if you close the program and reopen it, then this entry can be deleted without problems, it seems that the cache is not cleared

when adding a new record do
edit;
InsertRecord (...);
Query1.ApplyUpdates;
Query1.CommitUpdates;

when deleting
delete;
Query1.ApplyUpdates;
Query1.CommitUpdates;

What can be wrong?



victor   (2001-12-06 10:57) [1]

AU MASTAKI



victor   (2001-12-06 13:21) [2]

answer somebody, the program is written only this glitch remains
I am burning :-(



Hermit   (2001-12-06 15:58) [3]

Events
AfterDelete and AfterPost = UpdateTable

and in this procedure the following:

procedure Tdm.UpdateTable (DataSet: TDataSet);
begin
with DataSet as TDBDataSet do
begin
Database.StartTransaction;
try
ApplyUpdates; {try to write the updates to the database};
Database.Commit; {on success, commit the changes};
except
Database.Rollback; {on failure, undo the changes};
CancelUpdates;
raise; {raise the exception to prevent a call to CommitUpdates!}
end;
CommitUpdates; {on success, clear the cache}
end;
end;



victor   (2001-12-07 07:20) [4]

Thanks for the advice but the problem does not solve it
all the same, when you delete the newly inserted record, the UpdateFailed replica comes out, and if you close and open the program, you can delete it without problems



victor   (2001-12-07 12:32) [5]

remind not to forget :-)



Pages: 1 whole branch

Forum: "Bases";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Top









Memory: 0.82 MB
Time: 0.031 c
3-21931
SklifF
2001-12-04 15:59
2002.01.08
What is this mistake? Capability not suppoted


14-22350
Hedgehog
2001-11-04 16:49
2002.01.08
I sit here, and nothing to do!


4-22513
Oxy2
2001-10-23 23:23
2002.01.08
How to create forms with different controls on a pure API?


7-22440
Rumrunner
2001-05-13 00:32
2002.01.08
Win98 has the ability to allow Internet sharing for the local network.


14-22365
Ketmar
2001-10-16 06:22
2002.01.08
Here it is interesting: from Simferopol, am I here alone?





afrikaans albanian Arabic armenian azerbaijani basque belarusian bulgarian catalan Chinese (Simplified) Chinese (Traditional) croatian Czech danish Dutch English estonian filipino finnish French
galician georgian German greek haitian Creole hebrew Hindi hungarian icelandic indonesian Irish italian japanese Korean latvian lithuanian macedonian malay maltese norwegian
persian polish portuguese Romanian russian serbian slovak Slovenian Español swahili Swedish thai turkish Ukrainian urdu vietnamese welsh yiddish bengali bosnian
cebuano Esperanto gujarati hausa hmong igbo javanese kannada khmer lao latin maori marathi mongolian nepali punjabi somali tamil telugu yoruba
zulu
English French German Italian Portuguese Russian Spanish