F
faun
Unregistered / Unconfirmed
GUEST, unregistred user!
table1 结构
a auto
b character(20)
c boolean
...
procedure TForm1.BtnClick(Sender: TObject);
var
tmpAName : string;
begin
tmpAName := Inputbox('new value','value:','');
if tmpAName='' then exit;
with Dm.Qry do
begin
Append;
FieldbyName('b').asstring := tmpAName;
FieldByName('c').asBoolean := False;
post;
edit1.Text := inttostr(FieldByname('a').asinteger);
end;
end;
...
procedure TDM.QryAfterDelete(DataSet: TDataSet);
begin
with Qry Do
begin
ApplyUpdates;
CommitUpdates;
end;
end;
procedure TDM.QryAfterScroll(DataSet: TDataSet);
begin
Form1.edit2.Text := inttostr(Qry.FieldByname('a').asinteger);
end;
...
运行时加入新记录后,edit1.text edit2.text 本应是自动增量后的值,
但实际始终为0(当前记录为新加的),拜托各位指点一二;
a auto
b character(20)
c boolean
...
procedure TForm1.BtnClick(Sender: TObject);
var
tmpAName : string;
begin
tmpAName := Inputbox('new value','value:','');
if tmpAName='' then exit;
with Dm.Qry do
begin
Append;
FieldbyName('b').asstring := tmpAName;
FieldByName('c').asBoolean := False;
post;
edit1.Text := inttostr(FieldByname('a').asinteger);
end;
end;
...
procedure TDM.QryAfterDelete(DataSet: TDataSet);
begin
with Qry Do
begin
ApplyUpdates;
CommitUpdates;
end;
end;
procedure TDM.QryAfterScroll(DataSet: TDataSet);
begin
Form1.edit2.Text := inttostr(Qry.FieldByname('a').asinteger);
end;
...
运行时加入新记录后,edit1.text edit2.text 本应是自动增量后的值,
但实际始终为0(当前记录为新加的),拜托各位指点一二;