with ADOQuery3 do
     begin
          if Active Then Close;
          SQL.Clear;
          SQL.Add('select * from usersaccount where uin='+uin);
uin interger
这个要如何写 我这样写出错

解决方案 »

  1.   

    SQL.Add('select * from usersaccount where uin='+IntToStr(uin));
      

  2.   

    uin字段是int 前后2个都是int
      

  3.   

    其实就想要一个这样的sql
    select * from usersaccount where uin=5
      

  4.   

    转成str不是变成这样
    select * from usersaccount where uin='5'
      

  5.   

    SQL.Add(format('select * from usersaccount where uin=%d',[uin]));
      

  6.   

    SQL.Add('select * from usersaccount where uin='+IntToStr(uin));
    这样的结果就是
    select * from usersaccount where uin=5自己试一下就知道了!
      

  7.   

    with ADOQuery do
    begin
      .........
    end;
    都是用这个?
    下面这个不好用么?
     ADOQuery.Active := true;
     ADOQuery.SQL.Text := '';
     ADOQuery.Active := false;