当用dbgrid显示数据时,对表格中的数据操作时,在保存时,如何判断此时是修改数据还是增加一条记录保存呢?(30分)

N

noall

Unregistered / Unconfirmed
GUEST, unregistred user!
如移到表格的最底端就新增加一条记录,及在表格中某一条记录修改时都有保存?
如何区别
 
//我用的是adoquery1;
if adoquery1.state in[dsinsert] then showmessage('insert');
if adoquery1.state in[dsedit] then showmessage('edit');
if adoquery1.state in[dsbrowse] then showmessage('browse');
 
right
table也是一样的
table1.state是状态,具体见delphi帮助
 
多人接受答案了。
 
顶部