asp生成excel文件时乱码问题

用简单的生成excel出现了乱码,很多张表只有2张出现了问题。。。。求解决代码如下:
<!--#include file="connection.asp"-->
<%   
conn.Open ConnStr                                                                                         
set rs=server.createobject("adodb.recordset")  
strsql=session("strsql")
'lianjie = session("lianjie")
biao = session("biao")
chaxun_year=session("chaxun_year")
f_nianfen=session("chaxun_year")
session.Contents.Remove("chaxun_year")
session.Contents.Remove("f_nianfen")
 rs.open strsql,conn,1,3
if  rs.eof then
response.Write"<script>alert('对不起,没有您要查找的人!');history.back();</script>"
response.end
else
page=clng(request.QueryString("page"))
if page<=0  then
   page=1
  end if
  if request.QueryString("page")=""  then
  page=1
  end if
  rs.absolutepage=page
Response.ContentType = "application/vnd.ms-excel"
response.Charset="GB2312"
Response.AddHeader "Content-Disposition", "attachment;filename=训练.xls"
response.write "<table width=""100%"" border=""1"" >"
response.Write"<tr>"
response.write "<td colspan=""11"" align=""center""><b>训练汇总表 </b></td>"
response.Write"</tr>"
response.write "<tr>"
response.write "<td width=""40%"" align=""center""><b>姓名</b></td>"
response.write "<td width=""30%"" align=""center""><b>性别</b></td>"
response.write "<td width=""30%"" align=""center""><b>出生年月</b></td>"
response.write "<td width=""40%"" align=""center""><b>会员号</b></td>"
response.write "<td width=""30%"" align=""center""><b>家庭住址</b></td>"
response.write "<td width=""30%"" align=""center""><b>联系电话</b></td>"
response.write "<td width=""30%"" align=""center""><b>训练类别</b></td>"
response.write "<td width=""30%"" align=""center""><b>培训项目</b></td>"
response.write "<td width=""30%"" align=""center""><b>康复训练项目</b></td>"
response.write "<td width=""30%"" align=""center""><b>低保</b></td>"
response.write "<td width=""30%"" align=""center""><b>康复机构</b></td>"
response.write "</tr>"
   count=0
   do while not rs.eof
response.write "<tr>"
response.write "<td width=""40%"" align=""center"">"&rs("姓名")&"</td>"
response.write "<td width=""30%"" align=""center"">"&rs("性别")&"</b></td>"
response.write "<td width=""30%"" align=""center"">"&rs("出生年月")&"</td>"
response.write "<td width=""40%"" align=""center"">"&rs("会员证号")&"</td>"
response.write "<td width=""30%"" align=""center"">"&rs("家庭住址")&"</td>"
response.write "<td width=""30%"" align=""center"">"&rs("联系电话")&"</td>"
response.write "<td width=""30%"" align=""center"">"&rs("训练类别")&"</td>"
response.write "<td width=""30%"" align=""center"">"&rs("k_fzb_pxxm")&"</td>"
response.write "<td width=""30%"" align=""center"">"&rs("k_fzb_kfxlxm")&"</td>"
response.write "<td width=""30%"" align=""center"">"&rs("k_fzb_db")&"</td>"
response.write "<td width=""30%"" align=""center"">"&rs("k_fzb_kfjg")&"</td>"
response.write "</tr>"
count=count+1
rs.movenext

loop
end if
response.write "</table>"



  
%>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值