begin
dm.dw.Close;
dm.dw.SQL.Clear;
dm.dw.SQL.Add('insert into dw(dw_id,dwmc,xqts,xqed,xm,dh,bz,glr) value(dw_id1,dwmc1,xqts1,xqed1,xm1,dh1,bz1,glr1)');
dm.dw.ParamByName('dw_id1').AsString:=edit1.text;
dm.dw.ParamByName('dwmc1').AsString:=edit2.text;
dm.dw.ParamByName('xqts1').AsString:=edit3.text;
dm.dw.ParamByName('xqed1').AsString:=edit4.text;
dm.dw.ParamByName('xm1').AsString:=edit5.text;
dm.dw.ParamByName('dh1').AsString:=edit6.text;
dm.dw.ParamByName('bz1').AsString:=edit7.text;
dm.dw.ParamByName('glr1').AsString:=sysform.pass.text;
dm.dw.ExecSQL;
end;
他提示参数dw_id1没有被发现,请问怎么回事
6 个解决方案
#1
dm.dw.SQL.Add('insert into dw(dw_id,dwmc,xqts,xqed,xm,dh,bz,glr) value(:dw_id1,:dwmc1,:xqts1,:xqed1,:xm1,:dh1,:bz1,:glr1)');
#2
dm.dw.SQL.Add('insert into dw(dw_id,dwmc,xqts,xqed,xm,dh,bz,glr) value(:dw_id1,:dwmc1,:xqts1,:xqed1,:xm1,:dh1,:bz1,:glr1)');
#3
dm.dw.SQL.Add('insert into dw(dw_id,dwmc,xqts,xqed,xm,dh,bz,glr) value(:dw_id1,:dwmc1,:xqts1,:xqed1,:xm1,:dh1,:bz1,:glr1)');
如此低级的错误,^_^
如此低级的错误,^_^
#4
dm.dw.SQL.Add('insert into dw(dw_id,dwmc,xqts,xqed,xm,dh,bz,glr) value(:dw_id1,:dwmc1,:xqts1,:xqed1,:xm1,:dh1,:bz1,:glr1)');
#5
呵呵,刚学不太会在问一下我这个好像有语法错误,
那个xqts和xqed都是数值类型,是不是需要转换一下阿,请帮在改一下阿,谢谢
那个xqts和xqed都是数值类型,是不是需要转换一下阿,请帮在改一下阿,谢谢
#6
procedure Tkhdw.SpeedButton3Click(Sender: TObject);
begin
dm.dw.Close;
dm.dw.SQL.Clear;
dm.dw.SQL.Add('insert into dw(dw_id,dwmc,xqts,xqed,xm,dh,bz,glr) value(:dw_id1,:dwmc1,:xqts1,:xqed1,:xm1,:dh1,:bz1,:glr1)');
dm.dw.ParamByName('dw_id1').AsString:=edit1.text;
dm.dw.ParamByName('dwmc1').AsString:=edit2.text;
dm.dw.ParamByName('xqts1').Asfloat:=edit3.text;
dm.dw.ParamByName('xqed1').Asfloat:=edit4.text;
dm.dw.ParamByName('xm1').AsString:=edit5.text;
dm.dw.ParamByName('dh1').AsString:=edit6.text;
dm.dw.ParamByName('bz1').AsString:=edit7.text;
dm.dw.ParamByName('glr1').AsString:=sysform.pass.text;
dm.dw.ExecSQL;
end;
begin
dm.dw.Close;
dm.dw.SQL.Clear;
dm.dw.SQL.Add('insert into dw(dw_id,dwmc,xqts,xqed,xm,dh,bz,glr) value(:dw_id1,:dwmc1,:xqts1,:xqed1,:xm1,:dh1,:bz1,:glr1)');
dm.dw.ParamByName('dw_id1').AsString:=edit1.text;
dm.dw.ParamByName('dwmc1').AsString:=edit2.text;
dm.dw.ParamByName('xqts1').Asfloat:=edit3.text;
dm.dw.ParamByName('xqed1').Asfloat:=edit4.text;
dm.dw.ParamByName('xm1').AsString:=edit5.text;
dm.dw.ParamByName('dh1').AsString:=edit6.text;
dm.dw.ParamByName('bz1').AsString:=edit7.text;
dm.dw.ParamByName('glr1').AsString:=sysform.pass.text;
dm.dw.ExecSQL;
end;
#1
dm.dw.SQL.Add('insert into dw(dw_id,dwmc,xqts,xqed,xm,dh,bz,glr) value(:dw_id1,:dwmc1,:xqts1,:xqed1,:xm1,:dh1,:bz1,:glr1)');
#2
dm.dw.SQL.Add('insert into dw(dw_id,dwmc,xqts,xqed,xm,dh,bz,glr) value(:dw_id1,:dwmc1,:xqts1,:xqed1,:xm1,:dh1,:bz1,:glr1)');
#3
dm.dw.SQL.Add('insert into dw(dw_id,dwmc,xqts,xqed,xm,dh,bz,glr) value(:dw_id1,:dwmc1,:xqts1,:xqed1,:xm1,:dh1,:bz1,:glr1)');
如此低级的错误,^_^
如此低级的错误,^_^
#4
dm.dw.SQL.Add('insert into dw(dw_id,dwmc,xqts,xqed,xm,dh,bz,glr) value(:dw_id1,:dwmc1,:xqts1,:xqed1,:xm1,:dh1,:bz1,:glr1)');
#5
呵呵,刚学不太会在问一下我这个好像有语法错误,
那个xqts和xqed都是数值类型,是不是需要转换一下阿,请帮在改一下阿,谢谢
那个xqts和xqed都是数值类型,是不是需要转换一下阿,请帮在改一下阿,谢谢
#6
procedure Tkhdw.SpeedButton3Click(Sender: TObject);
begin
dm.dw.Close;
dm.dw.SQL.Clear;
dm.dw.SQL.Add('insert into dw(dw_id,dwmc,xqts,xqed,xm,dh,bz,glr) value(:dw_id1,:dwmc1,:xqts1,:xqed1,:xm1,:dh1,:bz1,:glr1)');
dm.dw.ParamByName('dw_id1').AsString:=edit1.text;
dm.dw.ParamByName('dwmc1').AsString:=edit2.text;
dm.dw.ParamByName('xqts1').Asfloat:=edit3.text;
dm.dw.ParamByName('xqed1').Asfloat:=edit4.text;
dm.dw.ParamByName('xm1').AsString:=edit5.text;
dm.dw.ParamByName('dh1').AsString:=edit6.text;
dm.dw.ParamByName('bz1').AsString:=edit7.text;
dm.dw.ParamByName('glr1').AsString:=sysform.pass.text;
dm.dw.ExecSQL;
end;
begin
dm.dw.Close;
dm.dw.SQL.Clear;
dm.dw.SQL.Add('insert into dw(dw_id,dwmc,xqts,xqed,xm,dh,bz,glr) value(:dw_id1,:dwmc1,:xqts1,:xqed1,:xm1,:dh1,:bz1,:glr1)');
dm.dw.ParamByName('dw_id1').AsString:=edit1.text;
dm.dw.ParamByName('dwmc1').AsString:=edit2.text;
dm.dw.ParamByName('xqts1').Asfloat:=edit3.text;
dm.dw.ParamByName('xqed1').Asfloat:=edit4.text;
dm.dw.ParamByName('xm1').AsString:=edit5.text;
dm.dw.ParamByName('dh1').AsString:=edit6.text;
dm.dw.ParamByName('bz1').AsString:=edit7.text;
dm.dw.ParamByName('glr1').AsString:=sysform.pass.text;
dm.dw.ExecSQL;
end;