asp查询sql语句未指定的错误 (0x80004005)

来源:百度知道 编辑:UC知道 时间:2024/05/14 15:20:59
程序功能为读取目录下所有图片名与数据表pics中的names做比较,显示出未查询到的图片.
代码如下
<%
'输出图片
j = 1
i = start
Set pp = New possible

Do While i < offset
thisPicPath = server.mappath("./" & fileArray(i))
If j > cEachLineMax Then
j = 1
response.Write "</tr><tr>"
End If

sql="select * from pics where names like '%"&fileArray(i)&"%'"
rs.open sql,conn,1,1
if rs.eof then
response.Write "<td style=""border: 1px solid #000000"" align=center><img border=0 src=" & fileArray(i) & " width=200 height=100><br>"& fileArray(i)&" <a href='del.asp?delimg="&fileArray(i)&"'>DEL</a></td>"

else
aj=aj+1
end if
j = j + 1
i = i + 1
rs.close
Loop

Set pp = Nothing
Set rs = Nothing
%>
iis提示
错误类型:

sql="select * from pics where [names] like '%"&fileArray(i)&"%'"

1服务器上是一直错误
Access 连接字符串地址请使用相对路径.
所以 认真检查下thisPicPath = server.mappath("./" & fileArray(i))
这句正误.

2服务器上的并不是一直错误,而是一时错误一时正常。

唯一可以解释的就是服务器临时文件满了!!!!服务器上的临时文件太多了,看来是要重新启动一下服务器,或者要清理临时文件或者调整磁盘空间了……

输出SQL语句,在数据库里运行一下,看有没有错误

set rs=server.createobject("adodb.recordset")
sql="select * from pics where names like '%"&fileArray(i)&"%'"