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'//推荐你用这种方法
靠,很简单呀。 1.先静态设置ado的相关属性,然后test成功后,在属性栏中剪切其connectionstring属性的内容; 2.编程设置相关属性: formCreate(); var appPath:string; begin appPath:=extractfilepath(application.exename); ... ado.connectionstring:='...'+appPath+'...'; end;
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'//推荐你用这种方法
1.先静态设置ado的相关属性,然后test成功后,在属性栏中剪切其connectionstring属性的内容;
2.编程设置相关属性:
formCreate();
var
appPath:string;
begin
appPath:=extractfilepath(application.exename);
...
ado.connectionstring:='...'+appPath+'...';
end;