回 帖 发 新 帖 刷新版面

主题:生成excel文件格式出错!急!急!急!求解.

我用下面的语句从数据库生成一个表格,用Response.ContentType="application/vnd.ms-excel"
变成excel让客户端下载,
但我发现不加
Response.ContentType="application/vnd.ms-excel"
语句的时候
bjbh=Request.form("select2")
能得到连接页面传送的"select2"能生成正常的网页格式的数据表格
但加上
Response.ContentType="application/vnd.ms-excel"

bjbh=Request.form("select2")
得到的班级代号就是空了,怎么办呢?
 
下面是我的程序
  Response.ContentType="application/vnd.ms-excel"
     bjbh=Request.form("select2")
     set rs2=server.createobject("adodb.recordset")
     rs2.open "select * from aryjbxx where bjbh='"&bjbh&"'",conn,1,1

回复列表 (共1个回复)

沙发

Response.ContentType="application/vnd.ms-excel"放到程序的最后一行。

我来回复

您尚未登录,请登录后再回复。点此登录或注册