###急,急,急,显示数据库Word文档的问题,大家帮忙!什么原因###

Cuilian521 2004-04-01 02:19:06
我在数据库的表里存了几个IMG型的字段(Word文档),显示的时候想弄一个连接,点击连接,把库里的Word文档读出来,如下:
1.ASP:

<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<a href="2.asp">文档</a>
</BODY>
</HTML>

///////////////////////////////////////////////////////

2.asp

<%
set conn=server.createobject("adodb.connection")
Connstr="Provider=SQLOLEDB;Data Source=172.16.0.1;UID=sa;PWD=sa;DataBase=BCA"
conn.open connstr


set rec=server.createobject("adodb.recordset")
strsql="select BACApply from BCA_Apply "
rec.open strsql,conngraph,1,1
Response.ContentType = "Application/msWord"
response.binarywrite rec("BACApply").getchunk(7500000)
rec.close
set rec=nothing
set conn=nothing
%>

///请问这么些对吗??运行有错!应该怎么改??各位小弟很急在线等待!
...全文
58 11 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
Cuilian521 2004-04-01
  • 打赏
  • 举报
回复
我的表里的字段又 ID,名字(VChar),文档1(IMG),文档2(IMG)这样行吗??为什么不好使!!??55555555555555
Cuilian521 2004-04-01
  • 打赏
  • 举报
回复
ghostzp兄?????!!!HElp!!
Cuilian521 2004-04-01
  • 打赏
  • 举报
回复
有人在吗???
dudemin 2004-04-01
  • 打赏
  • 举报
回复
<%
If Not Request("pId")="" Then
Set rs=Server.CreateObject("ADODB.recordset")
sql="select ContentType,Data from FileLibrary where pID='" & trim(request("pId")) &"'"
rs.open sql,conn,1,1

If Not (Rs.Eof And Rs.Eof) Then
Response.ContentType = Rs("ContentType")
Response.BinaryWrite rs("Data")
End If

rs.close
set rs=nothing
set conn=nothing
End If
%>

做个参考,我没工夫看
Cuilian521 2004-04-01
  • 打赏
  • 举报
回复
呀!!我好粗心!!不过改成CONN

错误类型:
Microsoft OLE DB Provider for SQL Server (0x80040E14)

我用的SQL 2000
若白师妹 2004-04-01
  • 打赏
  • 举报
回复
conngraph你都沒有定義
rec.open strsql,conngraph,1,1 改成 rec.open strsql,conn,1,3
Cuilian521 2004-04-01
  • 打赏
  • 举报
回复
?????ghostzp兄: 在吗?
Cuilian521 2004-04-01
  • 打赏
  • 举报
回复
rec.open strsql,conngraph,1,1
Response.ContentType = "Application/msWord"

附近错误 ADODB.Recordset
歪歪 2004-04-01
  • 打赏
  • 举报
回复
up
若白师妹 2004-04-01
  • 打赏
  • 举报
回复
錯誤提示?
改成try
rec.open strsql,conn,1,3
Cuilian521 2004-04-01
  • 打赏
  • 举报
回复
高手门,你们在吗!!!小弟需要帮助!

28,409

社区成员

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

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