用&代替+试试看...本来想说可能是你的name中有特殊字符如:'不过既然你用response.write都有问题的话就应该不是这个问题了...Response.Write("select * from util where name='"+ name+ "'")就这个语句来说我个人认为改下+号,,,如果还不行我也想不到什么原因了...呵呵...

解决方案 »

  1.   

    用'Set RSAllFinancialRecord=conn.Execute("select * from util where name='"&name&"'")试过,不行,才用Set RSAllFinancialRecord =conn.Execute("select * from util where name='"+ name+ "'")
    试,都不行呀,怪呀!!
      

  2.   

    换成
    sql="select * from util where name='"+ name+ "'"
    Set RSAllFinancialRecord =conn.Execute(sql)
      

  3.   

    问题最新进展:
     目前做法是把Response.ContentType = "application/vnd.ms-excel"
    测试时就把这句关闭,
    用Set RSAllFinancialRecord =conn.Execute("select * from util where name='"+ name+ "'")
    能在html显示出来,但不能成功生成到excel中去,
    但如果直接用'Set RSAllFinancialRecord = conn.Execute("select * from util where name = 'aa' ")
    可以写到excel中去,请问什么原因,如何修改?