QryTmp:=TADOQuery.Create(self);
  QryTmp.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+extractfilepat(application.ExeName)+'db.mdb;Persist Security Info=False';
  QryTmp.Close;
  QryTmp.SQL.Clear;
  QryTmp.SQL.Add('select * from mudb where id = '''+js+''' ');
(js定义的String格式)
怎么总提示格式不对??  ID 是表中 自动编号的,  要怎么写这个SQL?  以自动编号的数据作为条件

解决方案 »

  1.   

    QryTmp.SQL.Add('select * from mudb where id = '+js);
      

  2.   

    'select * from mudb where id = '+js
      

  3.   

    QryTmp.SQL.Add('select * from mudb where id = '+strtoint(js)+''); 
    试试这个
      

  4.   

    delphi 7  编译都不能通过,   'String' and 'Integer' 的错误
      

  5.   


    js为空造成的if length(trim(js))=0 then
    begin
      showmessage('js无值');
      exit
    end else QryTmp.SQL.Add('select * from mudb where id = '+js);