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

hebeiman 2003-11-10 05:01:16
<%@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>


上面是我做实验写的 可是打开全是乱吗不知怎么回事 能解决的定给高分
在线等待
...全文
74 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
Jaron 2003-11-10
  • 打赏
  • 举报
回复
删除HTML代码部分试试。
Response.ContentType ="application/msword" 要写在前面。

28,409

社区成员

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

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