adodataset1.commandtext:='select * from a_table where mingc=:xx';
ADODATASET1.Parameters.ParamByName('xx').VALUE:='1234';

解决方案 »

  1.   

    用TADOQUERY同样可以带参数呀,用法和BDE的TQUERY是一样的。
      

  2.   

    NO!:
    adodataset1.commandtext:='select * from a_table where mingc=:xx'; 
    ADODATASET1.Parameters.ParamByName('xx').asinteger:='1234'; 
    NO2:
       adoquery1.commandtext:='select * from a_table where mingc=:xx'; 
       adoquery1.Parameters[0].Value:='aaa'//推荐你用这种方法
      

  3.   

    靠,很简单呀。
    1.先静态设置ado的相关属性,然后test成功后,在属性栏中剪切其connectionstring属性的内容;
    2.编程设置相关属性:
    formCreate();
    var
      appPath:string;
    begin
      appPath:=extractfilepath(application.exename);
      ...
      ado.connectionstring:='...'+appPath+'...';
    end;