Transaction - how many ADOQuery required?
- From: "Naser" <n_fadaei@xxxxxxxxx>
- Date: Sat, 8 Mar 2008 08:47:21 +0330
Hi. Consider the following Transaction. Can I use only one ADOQuery (i.e.
ADOQuery1) for all the three "INSERT INTO" statements?
(Delphi 7)
// start the transaction on the connection
ADOConnection1.BeginTrans;
try
with ADOQuery1 do
begin
//INSERT INTO statement to table1
ExecSQL;
end;
with ADOQquery2 do
begin
//INSERT INTO statement to table1
ExecSQL;
end;
with ADOQquery3 do
begin
//INSERT INTO statement to table2
ExecSQL;
end;
ADOConnection1.CommitTrans;
except
On E:Exception do
begin
ADOConnection1.RollbackTrans;
end;
end;//try
.
- Follow-Ups:
- Re: Transaction - how many ADOQuery required?
- From: Bill Todd [TeamB]
- Re: Transaction - how many ADOQuery required?
- Prev by Date: Re: ADOConnection INSERT INTO error
- Next by Date: Transaction - how many ADOQuery required?
- Previous by thread: ADO and multiple connection component
- Next by thread: Re: Transaction - how many ADOQuery required?
- Index(es):
Relevant Pages
|