dbgrid+adotable 为什么不能 adotable.post?(20分)

  • 主题发起人 主题发起人 zhj218
  • 开始时间 开始时间
Z

zhj218

Unregistered / Unconfirmed
GUEST, unregistred user!
在dbgrid里操作
adotable1.edit;
adotable1.append;
adotable1.post;
执行post的时候系统提示不能插入空行
我用的是access2000数据库
 
提示说得很清楚了呀
不是不能post,是不能post空行
 
有什么办法能插入空行
 
你到底是要修改,還是增加一個空行。
1.adotable1.edit;
adotable1.post;
2.adotable1.append;
.......//進行賦值.否則為插入一空行,提交會出錯。空行(null)是不能提交的。
adotable1.post;
3.你若要插入一空行(指空字符),應含有一個字符型字段
adotable1.append;
for i:=0 to adotable1.fields.count-1 do
if (adotable1.Fields.DataType=ftString) or (adotable1.Fields.DataType=ftWideString) then
adotable1.Fields.AsString:='';
adotable1.post;
 
在数据里插入空行的同时在DBGRID里也插入空行
 
接受答案了.
 
后退
顶部