function TfrmMain.CheckBillNo(const BillNO:string;aUserID:integer):Boolean;
var
sSQL: String;
begin
result:= false;
//sSQL:= 'Select * From t_userlogin Where [手机号码]='''+PhoneNO+'''';
sSQL:= 'select * from shenpjg where [批复单号]='''+BillNO+''' and userid= '+inttostr(aUserID)+' and userid not in(select id from t_userlogin where [权限]=4) '
with frmDM.qryDSelect do
begin
Close;
SQL.Clear;
SQL.Append(sSQL);
Open;
if RecordCount > 0 then
begin
result:= true;
end
end;
end;
现在编译时出现如下错误,搞不懂了,求高手帮忙看一下:
[Error] Main.pas(422): Missing operator or semicolon
[Error] Main.pas(432): Incompatible types: 'String' and 'procedure, untyped pointer or untyped parameter'
[Fatal Error] SmsInterface.dpr(8): Could not compile used unit 'Main.pas'
var
sSQL: String;
begin
result:= false;
//sSQL:= 'Select * From t_userlogin Where [手机号码]='''+PhoneNO+'''';
sSQL:= 'select * from shenpjg where [批复单号]='''+BillNO+''' and userid= '+inttostr(aUserID)+' and userid not in(select id from t_userlogin where [权限]=4) '
with frmDM.qryDSelect do
begin
Close;
SQL.Clear;
SQL.Append(sSQL);
Open;
if RecordCount > 0 then
begin
result:= true;
end
end;
end;
现在编译时出现如下错误,搞不懂了,求高手帮忙看一下:
[Error] Main.pas(422): Missing operator or semicolon
[Error] Main.pas(432): Incompatible types: 'String' and 'procedure, untyped pointer or untyped parameter'
[Fatal Error] SmsInterface.dpr(8): Could not compile used unit 'Main.pas'
if CheckBillNo(sSmsCon_BillNO,iUserID) then
SendResultSms(sSmsAdd,'单据已审批,请勿重复审批!')
else
.......为什么,当CheckBillNo条件为true时上面的SendResultSms(sSmsAdd,'单据已审批,请勿重复审批!')不执行啊
加上 begin 和 end 再试试
加上 begin 和 end,也不行,接触delphi不多,所以对排错这块很头疼
begin
SendResultSms(sSmsAdd,'单据已审批,请勿重复审批!')
end
begin
SendResultSms(sSmsAdd,'单据已审批,请勿重复审批!'); // 你又忘了加分号
end
这也有一个和你类似的
你关了d,然后重开,重新编译一遍(Project菜单-Build 你的工程名)
你用的是ACCESS,就用MS ACCESS打开MDB,在左边的[对象]列里点击[查询],再双击右边的[在设计视图中创建查询]加以设计,就可以知道你的SQL语句是否正常