Recommended approach for using TMSQuery and TMSConnection
Posted: Thu 11 Aug 2005 01:35
Hello,
I am using cached updates with TMSQuery and TMSConnection. I am seeing strange errors. For details, see http://crlab.com/forums/viewtopic.php?t=1428
Instead of trying to figure out what is wrong, perhaps I can tackle this from another angle... can you guys at CORELAB please provide a recommended sequence of commands to commit cached updates?
I am currently doing this:
if msQuery.State in dsEditModes then begin
msConnection.StartTransaction;
try
msQuery.ApplyUpdates;
msConnection.Commit;
except
msConnection.RollBack;
end;
end;
Another question: I have noticed that sometimes (rarely) following the Commit, the msQuery.State is still equal to dsEdit! How can that happen? Should that happen?
Thanks,
Doug
I am using cached updates with TMSQuery and TMSConnection. I am seeing strange errors. For details, see http://crlab.com/forums/viewtopic.php?t=1428
Instead of trying to figure out what is wrong, perhaps I can tackle this from another angle... can you guys at CORELAB please provide a recommended sequence of commands to commit cached updates?
I am currently doing this:
if msQuery.State in dsEditModes then begin
msConnection.StartTransaction;
try
msQuery.ApplyUpdates;
msConnection.Commit;
except
msConnection.RollBack;
end;
end;
Another question: I have noticed that sometimes (rarely) following the Commit, the msQuery.State is still equal to dsEdit! How can that happen? Should that happen?
Thanks,
Doug