高分求救 把存在sql2000数据库中的word文档读出来在客户端显示

hebeiman 2003-11-10 09:48:44
<%@LANGUAGE="VBSCRIPT" CODEPAGE="CP_ACP"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<% response.buffer=true %>

<%


Set conn= CreateObject("ADODB.Connection")
conn.Open "Provider=SQLOLEDB.1;Password=mis;Persist Security Info=True;User ID=sa;Initial Catalog=maintepc;Data Source=信息室-刘建民"


strSQL ="SELECT gl_gcmc,gl_jcsj,gl_hjsj,gl_hjqk ,gl_hjtp ,tepc_attachfile1 ,tepc_attachfile2 FROM zb_zlgl..yzgc_gl where gl_jxbh=11"
Set rs = Server.CreateObject("ADODB.Recordset")


set rs=server.CreateObject("adodb.recordset")

rs.Open strsql,conn,1,3

file_Rname = "1.doc"
Response.ContentType ="application/msword"
Response.AddHeader "Content-Disposition","filename=" & file_Rname
imgsize=rs("tepc_attachfile2").actualsize
Response.BinaryWrite rs("tepc_attachfile2").getchunk(20000)
RESPONSE.End()
rs.close

set rs=nothing


%>
<body>

</body>
</html>


上面是我做实验写的 可是打开全是乱吗不知怎么回事 能解决的定给高分
在线等待
...全文
44 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
hebeiman 2003-11-10
  • 打赏
  • 举报
回复
谢谢 inelm(Archimond)和小才 问题解决
tuoshi 2003-11-10
  • 打赏
  • 举报
回复
1.取掉所有HTML置标。

2.检查客户端的Word。
nchen123 2003-11-10
  • 打赏
  • 举报
回复
http://expert.csdn.net/Expert/topic/2426/2426895.xml?temp=.2088282
starboy1413 2003-11-10
  • 打赏
  • 举报
回复
关注ing…………
nchen123 2003-11-10
  • 打赏
  • 举报
回复
提示一下,这个页面不能有任何的 html 标签输出。 包括 <!-- --> 注释符号。

建议你把所有 html 的东西去掉,应该就可以了。

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧