请高手指点为什么执行下面程序后,数据库(累加器)里的数据没累加(0分)

  • 主题发起人 主题发起人 dmk888
  • 开始时间 开始时间
D

dmk888

Unregistered / Unconfirmed
GUEST, unregistred user!
procedure Tdatahouse.orderdatasetNewRecord(DataSet: TDataSet);
var
vyear,vmonth,vday:word;
newid:integer;
smonth,sday:string;
代码:
strnew:string;
begin
decodedate(now,vyear,vmonth,vday);
iddataset.open;
if length(inttostr(vmonth))=1 then smonth:='0'+inttostr(vmonth) else smonth:=inttostr(vmonth);
if length(inttostr(vday))=1 then sday:='0'+inttostr(vday) else sday:=inttostr(vday);
if not iddataset.Locate('日期',inttostr(vyear)+smonth+sday,[]) then
begin
iddataset.Append;
iddatasetCDSDesigner.Value:=inttostr(vyear)+smonth+sday;
iddatasetnextid.value:='001';
end;
iddataset.Edit;
orderdatasetCDSDesigner.value:=iddatasetCDSDesigner.value+iddatasetnextid.Value;
newid:=strtoint(iddatasetnextid.Value)+1;
strnew:=inttostr(newid);
if length(strnew)=1 then iddatasetnextid.Value:='00'+strnew;
if length(strnew)=2 then iddatasetnextid.Value:='0'+strnew;
if length(strnew)=3 then iddatasetnextid.Value:=strnew;
iddataset.ApplyUpdates(0);
iddataset.close;
end;
 
后退
顶部