在asp中怎么查询access

来源:百度知道 编辑:UC知道 时间:2024/05/23 00:06:17
请各位帮帮忙,帮我看看这个代码哪里错误了
<!--#include file="conn.asp"-->
<% set rec=server.createobject("ADODB.recordset")
rec.open "select 照片 from 家教需求信息表信息 where id="& cstr(request(&"id"&)),conn,1,1
Response.ContentType = "image/pjpeg"
Response.BinaryWrite rec("图片").getChunk(7500000)
rec.close
set rec=nothing
conn.close
set conn=nothing
%>
网页中显示
语法错误
/my/tpxs_cp.asp, line 3, column 60
rec.open "select 照片 from 家教需求信息表信息 where id="& cstr(request(&"id"&)),conn,1,1
-----------------------------------------------------------^

因为不知道你的数据库,所以你要首先确定你的SQL语句中的字段名都都没有错误,而且“图片”字段是OLE类型的

然后把Response.ContentType = "image/pjpeg" 改为
Response.ContentType = "img/*"

其它的没有什么问题!