int iRecords;
AnsiString SQL;
SQL=(WideString)Input;
ADOQuery1->Close();
ADOQuery1->SQL->Clear();
ADOQuery1->SQL->Add(SQL);
ADOQuery1->Open();
return DataSetProvider1->GetRecords(10,iRecords,grReset);
这是我用BCB时使用过的代码,我不知道用DELPHI怎么表达,请大家帮忙,谢谢。

解决方案 »

  1.   


     var   iRecords:int;
          SQL:AnsiString ;
      SQL:=(WideString)Input;
    ADOQuery1.Close();
    ADOQuery1.SQL.Clear();
    ADOQuery1.SQL.Add(SQL);
    ADOQuery1.Open();
      return DataSetProvider1.GetRecords(10,iRecords,grReset);
    把return 改为函数名付值
      

  2.   

    SQL:=(WideString)Input;
    这一行过不去啊,怎么办?
    return怎么改能说得仔细一些吗?
      

  3.   

    [Error] Unit2.pas(50): '(' expected but ')' found
    [Error] Unit2.pas(55): Undeclared identifier: 'return'
    [Error] Unit2.pas(55): There is no overloaded version of 'GetRecords' that can be called with these arguments
    [Fatal Error] Project1.dpr(7): Could not compile used unit 'Unit2.pas'
      

  4.   

    var   
      iRecords: integer;ADOQuery1.Close;
    ADOQuery1.SQL.Clear;
    ADOQuery1.SQL.Add(Input);
    ADOQuery1.Open;
    Result := DataSetProvider1.GetRecords(10, iRecords, grReset);
      

  5.   

    [Error] Unit2.pas(54): There is no overloaded version of 'GetRecords' that can be called with these arguments
    [Fatal Error] Project1.dpr(7): Could not compile used unit 'Unit2.pas'