L
LJYY20000102
Unregistered / Unconfirmed
GUEST, unregistred user!
数据库名为ZLXHMX(ACCESS)字段名 sjxhsl为数字 双精度型
如下代码当EDIT9里的为整数时可以保存数据,当EDIT9为代整数小数时就提示
"ADOQuery1.Parameters.ParamByName('txhsl').Value:=edit9.Text;"有问题请帮忙看看
ADOQuery1.Close;
ADOQuery1.Sql.Clear ;
ADOQuery1.SQL.Add('insert into ZLXHMX(lrrq,cpmc,cpbh,clmc,clbh,xh,dw,xhsl,cjsl,cjrwd,CJDW,CJDWBH ,jhxhsl,jhXHSLJE,cpdw,ljjhxhsl,SHBZ,sjxhsl)'
+'valuestlrrq,:tcpmc,:tcpbh,:tclmc,:tclbh,:txh,:tdw,:txhsl,:tcjsl,:tcjrwd,:TCJDW,:TCJDWBH ,:tjhxhsl,:tjhXHSLJE,:tcpdw,:tLJjhxhsl,:TSHBZ,:tsjxhsl)');
ADOQuery1.parameters.ParamByName('tlrrq').value :=edit17.Text ;
ADOQuery1.parameters.ParamByName('tcpmc').value :=edit11.text;
ADOQuery1.Parameters.ParamByName('tcpbh').Value :=edit13.Text;
ADOQuery1.Parameters.ParamByName('tclmc').Value :=edit22.text;
ADOQuery1.parameters.ParamByName('tclbh').value :=edit15.text;
ADOQuery1.parameters.ParamByName('txh').value :=ComboBox4.Text;
ADOQuery1.parameters.ParamByName('tdw').value :=edit16.text;
ADOQuery1.Parameters.ParamByName('txhsl').Value:=edit9.Text;
ADOQuery1.parameters.ParamByName('tcjsl').value :=edit23.text;
ADOQuery1.Parameters.ParamByName('tcjrwd').Value :=edit10.TeXT;
ADOQuery1.parameters.ParamByName('TCJDW').value :=edit20.text;
ADOQuery1.Parameters.ParamByName('TCJDWBH').value:=edit25.TeXT;
ADOQuery1.Parameters.ParamByName('tcpdw').value:=edit14.TeXT;
ADOQuery1.Parameters.ParamByName('tjhxhsl').value:=ADOQuery3.fieldbyname('clyl').Value ;//计划单位消耗材料定额
// round(WGCPXHJE/SL*100)/100
//CCCC7:real;//完工产品成本 ---合计
ADOQuery1.Parameters.ParamByName('tsjxhsl').value:=round(strtoint(edit9.Text)/strtoint(edit23.Text)*100)/100;
ADOQuery1.Parameters.ParamByName('tljjhxhsl').value:=(EDIT23.Text*ADOQuery3.fieldbyname('clyl').Value) ;//累计计划单位消耗材料定额
//ADOQuery1.Parameters.ParamByName('tjhXHSLJE').value:=ADOQuery3.fieldbyname('clylje').Value ; //计划单位消耗材料金额
ADOQuery1.Parameters.ParamByName('TSHBZ').value:=ComboBox2.Text ; //材料消耗是否结转进产品的标志
ADOQuery1.ExecSQL;
如下代码当EDIT9里的为整数时可以保存数据,当EDIT9为代整数小数时就提示
"ADOQuery1.Parameters.ParamByName('txhsl').Value:=edit9.Text;"有问题请帮忙看看
ADOQuery1.Close;
ADOQuery1.Sql.Clear ;
ADOQuery1.SQL.Add('insert into ZLXHMX(lrrq,cpmc,cpbh,clmc,clbh,xh,dw,xhsl,cjsl,cjrwd,CJDW,CJDWBH ,jhxhsl,jhXHSLJE,cpdw,ljjhxhsl,SHBZ,sjxhsl)'
+'valuestlrrq,:tcpmc,:tcpbh,:tclmc,:tclbh,:txh,:tdw,:txhsl,:tcjsl,:tcjrwd,:TCJDW,:TCJDWBH ,:tjhxhsl,:tjhXHSLJE,:tcpdw,:tLJjhxhsl,:TSHBZ,:tsjxhsl)');
ADOQuery1.parameters.ParamByName('tlrrq').value :=edit17.Text ;
ADOQuery1.parameters.ParamByName('tcpmc').value :=edit11.text;
ADOQuery1.Parameters.ParamByName('tcpbh').Value :=edit13.Text;
ADOQuery1.Parameters.ParamByName('tclmc').Value :=edit22.text;
ADOQuery1.parameters.ParamByName('tclbh').value :=edit15.text;
ADOQuery1.parameters.ParamByName('txh').value :=ComboBox4.Text;
ADOQuery1.parameters.ParamByName('tdw').value :=edit16.text;
ADOQuery1.Parameters.ParamByName('txhsl').Value:=edit9.Text;
ADOQuery1.parameters.ParamByName('tcjsl').value :=edit23.text;
ADOQuery1.Parameters.ParamByName('tcjrwd').Value :=edit10.TeXT;
ADOQuery1.parameters.ParamByName('TCJDW').value :=edit20.text;
ADOQuery1.Parameters.ParamByName('TCJDWBH').value:=edit25.TeXT;
ADOQuery1.Parameters.ParamByName('tcpdw').value:=edit14.TeXT;
ADOQuery1.Parameters.ParamByName('tjhxhsl').value:=ADOQuery3.fieldbyname('clyl').Value ;//计划单位消耗材料定额
// round(WGCPXHJE/SL*100)/100
//CCCC7:real;//完工产品成本 ---合计
ADOQuery1.Parameters.ParamByName('tsjxhsl').value:=round(strtoint(edit9.Text)/strtoint(edit23.Text)*100)/100;
ADOQuery1.Parameters.ParamByName('tljjhxhsl').value:=(EDIT23.Text*ADOQuery3.fieldbyname('clyl').Value) ;//累计计划单位消耗材料定额
//ADOQuery1.Parameters.ParamByName('tjhXHSLJE').value:=ADOQuery3.fieldbyname('clylje').Value ; //计划单位消耗材料金额
ADOQuery1.Parameters.ParamByName('TSHBZ').value:=ComboBox2.Text ; //材料消耗是否结转进产品的标志
ADOQuery1.ExecSQL;