返回数据集应该用:
ADOQuery1.Open;请安装ADO的补丁

解决方案 »

  1.   

    改成如下看看可以吗:
    ADOQuery1.Active := false;
            ADOQuery1.SQL.Clear;
            ADOQuery1.sql.Add('select TrainNo from Train_Information where TrainNo like ');
            ADOQuery1.SQL.Add(''''+'%'+Trim(Edit2.Text)+'%'+'''');
            ADOQuery1.ExecSQL;
            ADOQuery1.Active := true;
    if adoquery1.eof and adoquery1.bof then
    begin
       adoquery1.recordset.close;
       adoquery1.close;
    end;
      

  2.   

    哪里有ADO补丁、ADO2.1或更高版本下载呀?
      

  3.   

    到www.borland.com上找,D5的补丁共三个。
    Setup Sn: ski-hd3-c139 92x0-91x0 or 555-555-5555 9ex0-91x0
      

  4.   

    既然是Select 查询语句就不要用.ExecSQL,要用.openCall ExecSQL to execute the SQL statement currently assigned to the SQL property. Use ExecSQL to execute queries that do not return a cursor to data (such as INSERT, UPDATE, DELETE, and CREATE TABLE).For SELECT statements, call Open instead of ExecSQL or set the Active property to True.
      

  5.   

    你为什么要用ExecSQL呢,只是select查询用Open不就行了
    with ADOQuery1 do
    begin
      if Active then Close;
      SQL.Clear;
      sql.Add('select TrainNo from Train_Information where TrainNo like ');
      SQL.Add(''''+'%'+Trim(Edit2.Text)+'%'+'''');
      Open;
      First;
      if eof then
       ..........
        Close;end;
      

  6.   

    为什么要用ExecSQL呢,一般的Select 查询用Open就行 了
    with ADOQuery1 do
    begin
            if Active then Close;
            SQL.Clear;
            sql.Add('select TrainNo from Train_Information where TrainNo like ');
            SQL.Add(''''+'%'+Trim(Edit2.Text)+'%'+'''');
            Open;
            First;
           if eof then Close;
           .................
    end;
      

  7.   

    不是用.open就行的问题,是不能用.execsql。我前面的英文解释已经说的清楚了。
      

  8.   

    改成如下看看可以吗:
          with ADOQuery1 do 
          begin
            Close;
            SQL.Clear;
            SQL.Add('select TrainNo from Train_Information where TrainNo like ');
            SQL.Add(''''+'%'+Trim(Edit2.Text)+'%'+'''');
            Open;
            if RecordCount=0 then
              Close;
          end;
    这么简单的东东要做的这么复杂干什么呢?
     
      

  9.   

    因为要在文本框中输入一个字符一个字符地输入,这样要找的东东就会被找出来了,效果像Delphi里面写了点号以后你每写一个字母就会筛选一次。
      

  10.   

    请问哪里可以下载delphi5的补丁呀?