delphi 中利用adotable组件向mysql数据库中添加数据出错
错误提示:adotable1:cannotperformthisoperationonacloseddataset程序为procedureTForm3.BitBtn1Cl...
错误提示:adotable1:cannot perform this operation on a closed dataset
程序为
procedure TForm3.BitBtn1Click(Sender: TObject);
begin
adotable1.Append ;
adotable1.FieldByName('USERID').AsString :=edit1.Text ;
adotable1.FieldByName('USERNAME').AsString :=edit2.Text ;
adotable1.fieldbyname('USERINI').AsString :=combobox1.text;
adotable1.fieldbyname('OTPCODE').asstring:=edit4.Text ;
adotable1.FieldByName('OTPSERIAL').AsString :=edit4.text;
adotable1.Post ;
adotable1.Refresh ;
form3.Close ;
end; 展开
程序为
procedure TForm3.BitBtn1Click(Sender: TObject);
begin
adotable1.Append ;
adotable1.FieldByName('USERID').AsString :=edit1.Text ;
adotable1.FieldByName('USERNAME').AsString :=edit2.Text ;
adotable1.fieldbyname('USERINI').AsString :=combobox1.text;
adotable1.fieldbyname('OTPCODE').asstring:=edit4.Text ;
adotable1.FieldByName('OTPSERIAL').AsString :=edit4.text;
adotable1.Post ;
adotable1.Refresh ;
form3.Close ;
end; 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询