用动态SQL语句:
for example:
declare @str varchar(200)
exec( 'select * from table where string='+@str)

解决方案 »

  1.   

    用动态SQL
    FOR EXAMPLE:
    declare @str varchar(200)
    exec 'select * from table where string='+@str
      

  2.   

    declare @str varchar(200)
    select @str = 'select * from table where string='+@arg
    execute(@str)
      

  3.   

    不明白你的意思
    你是要这个:
    adoquery1.SQL.add('select * from table where string='''+edit1.Text+'''');
    还是要这个:
    select * from  table1 where name=:name
    :name 你要自己在adoquery的parameters属性中定义