我是一个新学者,程序代码如下:
按增加按钮时:
TADOQuery1.open;
TADOQuery1.Append;
TDBedit1.SetFocus;
按结束按钮时:
TADOQuery1.post;
TADOQuery1.close;
但出现了以下错误,按增加按钮时,直接指向最后一条记录,然后输入内容后,按结束按钮时出现了
Project file_P.exe raised exception class EDatabaseError with message 'ghsda:Dataset not in edit or insert mode'. Process stopped. Use Step or Run to continue.
按增加按钮时:
TADOQuery1.open;
TADOQuery1.Append;
TDBedit1.SetFocus;
按结束按钮时:
TADOQuery1.post;
TADOQuery1.close;
但出现了以下错误,按增加按钮时,直接指向最后一条记录,然后输入内容后,按结束按钮时出现了
Project file_P.exe raised exception class EDatabaseError with message 'ghsda:Dataset not in edit or insert mode'. Process stopped. Use Step or Run to continue.
TADOQuery1.Edit;
TADOQuery1.Append;
TDBedit1.SetFocus;
如果还不行,在
Post前加TADOQuery1.Edit;
begin
Open;
setfocus;
insert;
post;
close;
end;
TDBedit1.SetFocus
TADOQuery1.open;
TADOQuery1.Append;
我按reallike的要求改了,但是出现以下问题:
Debugger Exception Notification
Project ghs_P.exe raised exception class EOleException with message '无法插入空行。行必须至少有一个列值集。'Process stopped. Use step or Run to continue.
,我想他一定是adoquery用的是查询语句,所以后面的不能用,我告诉你,你要是用ADOQUERY的话就必须自己写增加的代码才行,
要不,你就用ADOTABLE