这个问题 比较简单,当局者迷,寻求解决。num1,num2:integer; with DM.Outputqry do
begin
Close;
SQL.Clear;
SQL.Add('select 数量 from 库存清单 where 货号='''+stringgrid1.Cells[1,currentRow]+'''');
Open;
Num1:=StrToInt(DM.OutputQry.FieldByName('数量').AsString);
end; Num2:=StrToInt(StringGrid1.Cells[1,3]);
Num3:=Num1-num2;
with DM.Outputqry do
begin
Close;
SQL.Clear;
SQL.Add('update 库存清单 set 数量=num3 where 货号='''+stringgrid1.cells[1,1]+''' ');
ExecSQL;
end;在 库存清单 中 设置的 '数量 ' 类型 为 int。运行的时候提示 ' is not a valid integer'
begin
Close;
SQL.Clear;
SQL.Add('select 数量 from 库存清单 where 货号='''+stringgrid1.Cells[1,currentRow]+'''');
Open;
Num1:=StrToInt(DM.OutputQry.FieldByName('数量').AsString);
end; Num2:=StrToInt(StringGrid1.Cells[1,3]);
Num3:=Num1-num2;
with DM.Outputqry do
begin
Close;
SQL.Clear;
SQL.Add('update 库存清单 set 数量=num3 where 货号='''+stringgrid1.cells[1,1]+''' ');
ExecSQL;
end;在 库存清单 中 设置的 '数量 ' 类型 为 int。运行的时候提示 ' is not a valid integer'
解决方案 »
- 关于RadioGroup组建创建的疑惑
- 第一次查询很快,4秒,第二次要40秒,为什么?
- 登陆代码问题啊?????找到的进,给点意见和建议
- 请问——编译组件出现错误:[Fatal Error] Could not create output file 'g:\delphi\Projects\Bpl\f1bookdesigncom.bpl'
- 如何压缩加了密码的ACCESS数据库??
- 各位兄弟,明年准备订什么书啊?
- 如何获得拨号连接的用户名和密码?
- 如果我想得form1中panel1面板上的控件数,可以这么写吗:form1.panel1.componentcount?
- 一个小问题,大家帮帮忙。
- 请各位delphi爱好者介绍一下好的网站,(市面上常见的就不用说了)
- 手写识别算法
- delphi5安装失败
SQL.Add('update 库存清单 set 数量=num3 where 货号='''+stringgrid1.cells[1,1]+''' ');
ExecSQL
这句。
实在想不起 为什么会错。
SQL.Add('update 库存清单 set 数量=num3 where 货号='''+stringgrid1.cells[1,1]+''' ');
num3没在SQL中替换
SQL.Add('update 库存清单 set 数量 = ' + IntToStr(num3) + ' where 货号='''+stringgrid1.cells[1,1]+''' ');
Num2:=StrToInt(StringGrid1.Cells[1,3])
why
SQL.Add('update 库存清单 set 数量='+inttostr(num3)+' where 货号='''+stringgrid1.cells[1,1]+''' ');