新手,请帮帮我,为什么程序提示成功,却不往数据库插入数据
procedure TForm1.Button1Click(Sender: TObject);
begin
try
with adoquery1 do
begin
close;
sql.Clear;
sql.Add('insert into m_conputer_list(CONPUTER_NO,CONPUTER_BRAND,CONPUTER_TYPE,CONPUTER_ID,'+
'CO_FACTORY_DATE,BUY_DATE,CONFIG_MEMO,DEPT_NO,CO_OWNER,NIC_MACADRESS,IP_ADRESS,'+
'CONPUTER_TITLE,RECOVERY_TIME,CON_NOTE1,CON_NOTE2,CON_NOTE3)'+
'values (:CONPUTER_NO,:CONPUTER_BRAND,:CONPUTER_TYPE,:CONPUTER_ID,'+
':CO_FACTORY_DATE,:BUY_DATE,:CONFIG_MEMO,:DEPT_NO,:CO_OWNER,:NIC_MACADRESS,:IP_ADRESS,'+
':CONPUTER_TITLE,:RECOVERY_TIME,:CON_NOTE1,:CON_NOTE2,:CON_NOTE3)');
parameters.ParamByName('CONPUTER_NO').Value:=edit1.Text;
parameters.ParamByName('CONPUTER_BRAND').Value:=combobox1.Items[combobox1.ItemIndex];
parameters.ParamByName('CONPUTER_TYPE').Value:=edit2.Text;
parameters.ParamByName('CONPUTER_ID').Value:=edit3.Text;
parameters.ParamByName('CO_FACTORY_DATE').Value:=DateTimePicker1.Date;
parameters.ParamByName('BUY_DATE').Value:=DateTimePicker2.Date;
parameters.ParamByName('CONFIG_MEMO').Value:=memo1.Text;
parameters.ParamByName('DEPT_NO').Value:=combobox2.Items[combobox2.ItemIndex];
parameters.ParamByName('CO_OWNER').Value:=edit4.Text;
parameters.ParamByName('NIC_MACADRESS').Value:=edit5.Text;
parameters.ParamByName('IP_ADRESS').Value:=edit6.Text;
parameters.ParamByName('CONPUTER_TITLE').Value:=combobox3.Items[combobox3.ItemIndex];
parameters.ParamByName('RECOVERY_TIME').Value:=DateTimePicker3.Date;
parameters.ParamByName('CON_NOTE1').Value:=memo2.Text;
parameters.ParamByName('CON_NOTE2').Value:=memo3.Text;
parameters.ParamByName('CON_NOTE3').Value:=memo4.Text;
Prepared:=true;
MessageDlg('确认要保存吗?',mtConfirmation,[mbOK],0);
Execsql;
end;
MessageDlg('Success' ,mtConfirmation,[mbOK],0);
except
end;
edit1.Clear;
edit2.Clear;
edit3.Clear;
edit4.Clear;
edit5.Clear;
edit6.Clear;
memo1.Clear;
memo2.Clear;
memo3.Clear;
memo4.Clear;
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
close;
end;
提示保存成功,但是库里是空的