用动态SQL FOR EXAMPLE: declare @str varchar(200) exec 'select * from table where string='+@str
declare @str varchar(200) select @str = 'select * from table where string='+@arg execute(@str)
不明白你的意思 你是要这个: adoquery1.SQL.add('select * from table where string='''+edit1.Text+''''); 还是要这个: select * from table1 where name=:name :name 你要自己在adoquery的parameters属性中定义
FOR EXAMPLE:
declare @str varchar(200)
exec 'select * from table where string='+@str
select @str = 'select * from table where string='+@arg
execute(@str)
你是要这个:
adoquery1.SQL.add('select * from table where string='''+edit1.Text+'''');
还是要这个:
select * from table1 where name=:name
:name 你要自己在adoquery的parameters属性中定义