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'

解决方案 »

  1.   

    楼上大哥真厉害,但还有一个问题
                          if CheckBillNo(sSmsCon_BillNO,iUserID) then
                             SendResultSms(sSmsAdd,'单据已审批,请勿重复审批!')
                       else
                             .......为什么,当CheckBillNo条件为true时上面的SendResultSms(sSmsAdd,'单据已审批,请勿重复审批!')不执行啊
      

  2.   

    你跟踪了吗?
    加上 begin 和 end 再试试
      

  3.   


    加上 begin 和 end,也不行,接触delphi不多,所以对排错这块很头疼
      

  4.   

                          if CheckBillNo(sSmsCon_BillNO,iUserID) then
                            begin
                             SendResultSms(sSmsAdd,'单据已审批,请勿重复审批!')
                            end
      

  5.   

    if CheckBillNo(sSmsCon_BillNO,iUserID)=true then 
      

  6.   

    首先你确定运行那句判断代码了                      if CheckBillNo(sSmsCon_BillNO,iUserID) then
                            begin
                            SendResultSms(sSmsAdd,'单据已审批,请勿重复审批!'); // 你又忘了加分号
                            end
      

  7.   

    http://topic.csdn.net/u/20091007/09/6f2cf71e-c6e3-4f39-a609-21163f216fa6.html
    这也有一个和你类似的
    你关了d,然后重开,重新编译一遍(Project菜单-Build 你的工程名)
      

  8.   

    如何跟踪出SQL语句执行的情况啊?
      

  9.   

    跟踪CheckBillNo的代码啊,返回为false当然不会执行啊
      

  10.   


    你用的是ACCESS,就用MS ACCESS打开MDB,在左边的[对象]列里点击[查询],再双击右边的[在设计视图中创建查询]加以设计,就可以知道你的SQL语句是否正常
      

  11.   

    也可以把数据导入到MSSQL里再查