R rodmanxu Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-21 #1 我使用ADOQuery时,想在SQL语句中动态指定数据表名,如select * from table where…… 这里的table可否当作参数赋值?
C china_peng Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-21 #2 当然可以 var strTabName:string; strTabName:='table1'; ADOQuery.close; ADOQuery.sql.clear; ADOQuery1.SQL.Add('select * from '+strTabName+' ');
当然可以 var strTabName:string; strTabName:='table1'; ADOQuery.close; ADOQuery.sql.clear; ADOQuery1.SQL.Add('select * from '+strTabName+' ');
H hurryman Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-21 #3 var tablename :string ; tablename :=//you table name ; adoquery.sql.add('select * from '+tablename+' where ') ;
var tablename :string ; tablename :=//you table name ; adoquery.sql.add('select * from '+tablename+' where ') ;
L lookingin Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-21 #4 adoquery.sql.add('select * from '+tablename+' where ') ;
碧 碧血剑 Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-21 #6 adoquery.sql.text := format('select * from %s ', [TableName])