然后数据可以写入数据库表的,
所以希望大家可以帮我看看程序,是哪里出了问题的。谢谢先了。
程序如下:
procedure TForm1.Button1Click(Sender: TObject);
dbgrid1.Enabled:=true;
query1.Close;
query1.SQL.Clear;
query1.SQL.Add('insert into LongUser values(:yhID,:yhm,:cph,:syqx,:kssj,:jssj,:ckh,:lxdh)');
query1.ParamByName('yhID').AsString:=edit1.Text;
query1.ParamByName('yhm').AsString:=edit5.Text;
query1.ParamByName('cph').AsString:=edit2.Text;
query1.ParamByName('syqx').AsString:=edit6.Text;
query1.ParamByName('kssj').AsString:=edit3.Text;
query1.ParamByName('jssj').AsString:=edit7.Text;
query1.ParamByName('ckh').AsString:=edit4.Text;
query1.ParamByName('lxdh').AsString:=edit8.Text;
query1.ExecSQL;
query1.Active:=false;
query1.SQL.Clear;
query1.SQL.Add('select User-ID,User-Name,User-Cph,User-Qixian,User-Begin,User-Over,User-Ckh,User-Tel from LongUser');
query1.ExecSQL;
edit1.Text:='';
edit2.Text:='';
edit3.Text:='';
edit4.Text:='';
edit5.Text:='';
edit6.Text:='';
edit7.Text:='';
edit8.Text:='';
end;