我找了个asp上传和读取图片的程序,修改了一下,想自己用,可水平太低, show.asp(读取显示图片的文件)报错 Microsoft VBScript 编译器错误 错误 '800a03f6' 缺少 'End' /iisHelp/common/500-100.asp,行242 Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e21' ODBC 驱动程序不支持所需的属性。 /nyjcy/show.asp,行11 代码如下: <% set connGraph=server.CreateObject("ADODB.connection") connGraph.ConnectionString="Driver={sql server};server=prolover;database=ejubao;uid=sa;pwd=;" connGraph.Open set rec=server.createobject("ADODB.recordset") strsql="select img from images where id=" & trim(request("id")) 'strsql="select img from images where id=1" rec.open strsql,connGraph,1,1 Response.ContentType = "image/*" Response.BinaryWrite rec("img").getChunk(7500000) rec.close set rec=nothing set connGraph=nothing %> 到底是咋了?!
这样写试试呢? <% set connGraph=server.CreateObject("ADODB.connection") connGraph.ConnectionString="Driver={sql server};server=prolover;database=ejubao;uid=sa;pwd=;" connGraph.Open set rec=server.createobject("ADODB.recordset") if request("id")<>"" then strsql="select img from images where id=" &request("id") rec.open strsql,connGraph,1,1 if not rec.eof then Response.ContentType = "image/*" Response.BinaryWrite rec("img").getChunk(7500000) end if rec.close set rec=nothing set connGraph=nothing end if %>