R
riversoft
Unregistered / Unconfirmed
GUEST, unregistred user!
有三张表
Pruducts 产品库存表
---------------------------
ProductID Stock
Orders 定单表
----------------------------
OrderID OrderDate
OrderDetails 定单详细表
-----------------------------------
OrderID ProductID Quantity
用delphi6+Ado+SqlServer2000
AdsOrderDetails:TAdoDataSet;
AdsOrderDetails.LockType:=ltBatchOptimistic;
AdsOrderDetails.CommandText:='Select * from OrderDetails';
BtnSaveClick(Sender:TObject)
begin
adoConnection.BeginTrans;
AdsOrderDetails.First;
while not AdsOrderDetails.eof do
begin
case AdsOrderDetails.UpdateStatus do
usInserted:在Products中扣除相应的库存入;
usDeleted:在Products中加入相应的库存入;
end;
end;
AdsOrderDetails.UpdateBatch;
end;
现在其他算法不管,只是usDeleted的记录无发定位啊,
到底要怎样才能定位到已删除的记录上呢,
我不想用TClientdataSet来协助。
Pruducts 产品库存表
---------------------------
ProductID Stock
Orders 定单表
----------------------------
OrderID OrderDate
OrderDetails 定单详细表
-----------------------------------
OrderID ProductID Quantity
用delphi6+Ado+SqlServer2000
AdsOrderDetails:TAdoDataSet;
AdsOrderDetails.LockType:=ltBatchOptimistic;
AdsOrderDetails.CommandText:='Select * from OrderDetails';
BtnSaveClick(Sender:TObject)
begin
adoConnection.BeginTrans;
AdsOrderDetails.First;
while not AdsOrderDetails.eof do
begin
case AdsOrderDetails.UpdateStatus do
usInserted:在Products中扣除相应的库存入;
usDeleted:在Products中加入相应的库存入;
end;
end;
AdsOrderDetails.UpdateBatch;
end;
现在其他算法不管,只是usDeleted的记录无发定位啊,
到底要怎样才能定位到已删除的记录上呢,
我不想用TClientdataSet来协助。