var
  s:string;
begin
  s:=combobox1.SelText;
  query1.SQL.Add('select 编号 from 出件登记表 where 地区=s');
  query1.Open;
  query1.Last;
end
怎么编译时出来
[Error] Unit1.pas(91): Missing operator or semicolon错误呀是怎么回事儿呢?

解决方案 »

  1.   

    s:=combobox1.Items[combobox1.ItemIndex];
      

  2.   

    按照楼上的那样改掉过后,还是不行呀,还是显示[Error] Unit1.pas(91): Missing operator or semicolon错误呀
      

  3.   

    sorry,看错,应该是这样的
    query1.SQL.Add('select 编号 from 出件登记表 where 地区='''+s+'''');
      

  4.   

    我把它改成这样的了还是一样的错误提示呀var
      s:string;
    begin
      s:=combobox1.Items[combobox1.itemindex];
      query1.SQL.Add('select 编号 from 出件登记表 where 地区='''+s+'''');  
      query1.Open;
      query1.Last;
    end
      

  5.   

    var
      s:string;
    begin
      s:=combobox1.Items[combobox1.itemindex];
      query1.SQL.Clear;  //加上这句试试
      query1.SQL.Add('select 编号 from 出件登记表 where 地区='''+s+'''');  
      query1.Open;
      query1.Last;
    end
      

  6.   

    var
      s:string;
    begin
      s:=combobox1.text;
      query1.SQL.Clear;  
      query1.SQL.Add('select 编号 from 出件登记表 where 地区='''+s+'''');  
      query1.Open;
      query1.Last;
    end