Re: Recovering from an updatebatch error with a clone
- From: "damian marquez" <dmarquez34@xxxxxxxxxxx>
- Date: Fri, 28 Oct 2005 22:35:36 -0300
Brian Bushay TeamB <BBushay@xxxxxxxxx> wrote:
> When you loadfromStream the connection is set to null.
> You will have to set the connection again
> In the ADO demos there is one for Briefcase mode. That is basically
> what you are doing here when you savetoStream then loadfromStream
I've watched that demo after your advice but somehow I cannot get it to
work... After retrying I keep
my old data but trying to save it I get the same error that the "row cannot
be located" because values may
have changed. Some Requery goes somewhere?
in short, the code to save the operation I am using (now with savetofile,
but same probelm) would be:
// reconnecting to connection if necessary
if dstMaster.Connection = nil then
dstMaster.Connection:=MainDataModule.conMain;
if dstDetail.Connection = nil then
dstDetail.Connection:=MainDataModule.conMain;
// here goes the transaction.
MainDataModule.conMain.BeginTrans;
dstMaster.SaveToFile('vouchm.adtg');
dstDetail.SaveToFile('vouchd.adtg');
try
// try to apply the changes.
dstMaster.UpdateBatch;
dstDetail.UpdateBatch;
if MainDataModule.conMain.InTransaction then
MainDataModule.conMain.CommitTrans;
except
on E:Exception do begin
if MainDataModule.conMain.InTransaction then
MainDataModule.conMain.RollbackTrans;
dstMaster.Connection:=nil;
dstDetail.Connection:=nil;
dstMaster.LoadFromFile('vouchm.adtg');
dstDetail.LoadFromFile('vouchd.adtg');
dstMaster.Open;
dstMaster.Edit;
dstDetail.Open;
end;
end;
--
Have you seen Marillion's Marbles? Visit www.marillion.com and get in
touch with the most amazing music...
.
- Follow-Ups:
- Re: Recovering from an updatebatch error with a clone
- From: Brian Bushay TeamB
- Re: Recovering from an updatebatch error with a clone
- References:
- Recovering from an updatebatch error with a clone
- From: damian marquez
- Re: Recovering from an updatebatch error with a clone
- From: damian marquez
- Re: Recovering from an updatebatch error with a clone
- From: Brian Bushay TeamB
- Recovering from an updatebatch error with a clone
- Prev by Date: Re: Pb while closing ADO query
- Next by Date: Re: Pb while closing ADO query
- Previous by thread: Re: Recovering from an updatebatch error with a clone
- Next by thread: Re: Recovering from an updatebatch error with a clone
- Index(es):
Relevant Pages
|