我想做个查询:
  ‘select tz_name from t_zubie where tz_id=’(这后面该怎么写呢?tz_id是数字类型的,我想设置查询条件为tz_id等于一个外部自定义的变量,可不知该怎么连接起来。请高手指点)

解决方案 »

  1.   

    'select tz_name from t_zubie where tz_id='+变量
    就可以了阿!
      

  2.   


      ‘select tz_name from t_zubie where tz_id=’+变量
      

  3.   

    数值类型
    'select tz_name from t_zubie where tz_id=' + Edit1.Text
    字符类型
    'select tz_name from t_zubie where tz_id=''' + Edit1.Text + ''''
      

  4.   

    query1.Close;
    query1.SQL.Clear;
    query1.SQL.Add('select tz_name from t_zubie where tz_id=:Atz_Id');
    query1.ParamByName('Atz_Id').AsFloat:=mm;
    query1.OPen;
    mm为外部变量
      

  5.   

    'select tz_name from t_zubie where tz_id=' + strtoint(Edit1.Text)