一个很纳闷的关于adotable的问题

煜知搬砖者 2002-03-07 03:58:34
我的程序如下:
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
Adotable1.Edit;
Adotable.AppendRecord ([Edit1.Text,Edit2.Text,Edit3.Text,Edit4.Text,Edit5.Text)
DataFrm.AppendBmk.Post;
end;

编译没有出错,但是单击该按钮的时候,却出现:Adotable1:"Dataset not in edit or insert mode"
请问这是怎么回事?
...全文
84 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
煜知搬砖者 2002-03-07
  • 打赏
  • 举报
回复
ok,解决问题
eiffeltower 2002-03-07
  • 打赏
  • 举报
回复
是的,这里是不需要post的,try it again
ken_henderson 2002-03-07
  • 打赏
  • 举报
回复
把DataFrm.AppendBmk.Post这句删去就行了
kplchx 2002-03-07
  • 打赏
  • 举报
回复
APPENDRECORD

//注意此处
Adds a new, populated record to the end of the dataset and posts it to the database.

procedure AppendRecord(const Values: array of const);

Description

Call AppendRecord to create a new, empty record at the end of the dataset, populate it with the field values in Values, and post the values to the database.

A newly appended record is posted to the database in one of three ways:

For indexed Paradox and dBASE tables, the record is inserted into the dataset in a position based on its index.
For unindexed Paradox and dBASE tables, the record is added to the end of the dataset.
For SQL databases, the physical location of the append is implementation-specific. For indexed tables, the index is updated with the new record information.

The newly appended record becomes the active record.


煜知搬砖者 2002-03-07
  • 打赏
  • 举报
回复
但是我用sql explore 察看了一下表,发现数据的确插入进去了,高手指点阿
煜知搬砖者 2002-03-07
  • 打赏
  • 举报
回复
那位高手肯指点一下啊?

5,392

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧