delphi 出错Incompatible types: 'String' and 'Integer'
procedureTForm6.btn1Click(Sender:TObject);varS1:string;beginwithunit1.CreationForm.qr...
procedure TForm6.btn1Click(Sender: TObject);
var
S1:string;
begin
with unit1.CreationForm.qry2 do
begin
Close;
sql.Clear;
SQL.Add('select * from Template where partnum='''+edt1.text+'''');
Open;
unit1.CreationForm.lbl3.Caption:=fieldbyname('partname').asstring;
unit1.CreationForm.lbl9.Caption:=fieldbyname('partnum').asstring;
unit1.CreationForm.pnl5.Caption:=fieldbyname('CodR').asstring;
S1:=fieldbyname('NSJECT1').asstring;
end;
if unit1.CreationForm.qry2.RecordCount<>1 OR s1='' then
begin
MessageBox(handle,'无此件号或未填写项目!','Error',MB_ICONHAND);
Exit;
end
else
unit1.CreationForm.dbgrdh1.Enabled:=false;
MessageBox(handle,'导入成功!','提示',MB_OK+MB_ICONASTERISK);
end;
上面的 if unit1.CreationForm.qry2.RecordCount<>1 OR s1='' then 这里错误! 展开
var
S1:string;
begin
with unit1.CreationForm.qry2 do
begin
Close;
sql.Clear;
SQL.Add('select * from Template where partnum='''+edt1.text+'''');
Open;
unit1.CreationForm.lbl3.Caption:=fieldbyname('partname').asstring;
unit1.CreationForm.lbl9.Caption:=fieldbyname('partnum').asstring;
unit1.CreationForm.pnl5.Caption:=fieldbyname('CodR').asstring;
S1:=fieldbyname('NSJECT1').asstring;
end;
if unit1.CreationForm.qry2.RecordCount<>1 OR s1='' then
begin
MessageBox(handle,'无此件号或未填写项目!','Error',MB_ICONHAND);
Exit;
end
else
unit1.CreationForm.dbgrdh1.Enabled:=false;
MessageBox(handle,'导入成功!','提示',MB_OK+MB_ICONASTERISK);
end;
上面的 if unit1.CreationForm.qry2.RecordCount<>1 OR s1='' then 这里错误! 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询