禁止吸烟指示牌:Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e21' ODBC 驱动程序不支持所需的属性。
来源:百度文库 编辑:神马品牌网 时间:2024/10/03 03:56:08
<%set rsn=server.createobject("adodb.recordset")
这里是第44行:rsn.open "select top "&dispnums&" cxn,id,pics,dates from rs_news where tid="&newssbno&" and id<>"&newsid&" ",conn,1
do while not rsn.eof
cxn=rsn("cxn")
id=rsn("id")
pics=rsn("pics")
cxn="<a href=newsdisp.asp?id="&id&" target=_blank>"&cxn&"</a>"
if pics<>"" and len(pics)>5 then cxn=cxn&" (图文)"
dates=formatdatetime(rsn("dates"),2)
cxn=cxn&" <font color=#ff0000>"&dates&"</font>"
%>
高手请教一下这里面有什么问题吗
'''''''''''''''''''''''''''''' Access数据库 '''''''''''''''''''''''''''''''''''''''''''''''''''''''''
datapath ="../database/" '数据库目录的相对路径
datafile ="cmsdata.mdb" '数据库的文件名
Connstr="DBQ="&server.mappath(""&datapath&""&datafile&"")&";DRIVER={Microsoft Access Driver (*.mdb)};"
SqlNowString="Now()"
end if
ver="2005"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'On Error Resume Next
Set conn=Server.CreateObject("ADODB.Connection")
conn.open ConnStr
If Err Then
err.Clear
Set Conn = Nothing
Response.Write "数据库连接出错,请检查连接字串。"
Response.End
End If
On Error GoTo 0
%>
其实就是这里有一个ID不能为空的句子,and id<>"&newsid&"
去是不能去掉这一句,加上这一句后,就会出错,以前数据库里有内,不会出错,我直接打开数据库删除了里面以前的内容后就报错了,通过后台添加上的也没有,还是报错
这里是第44行:rsn.open "select top "&dispnums&" cxn,id,pics,dates from rs_news where tid="&newssbno&" and id<>"&newsid&" ",conn,1
do while not rsn.eof
cxn=rsn("cxn")
id=rsn("id")
pics=rsn("pics")
cxn="<a href=newsdisp.asp?id="&id&" target=_blank>"&cxn&"</a>"
if pics<>"" and len(pics)>5 then cxn=cxn&" (图文)"
dates=formatdatetime(rsn("dates"),2)
cxn=cxn&" <font color=#ff0000>"&dates&"</font>"
%>
高手请教一下这里面有什么问题吗
'''''''''''''''''''''''''''''' Access数据库 '''''''''''''''''''''''''''''''''''''''''''''''''''''''''
datapath ="../database/" '数据库目录的相对路径
datafile ="cmsdata.mdb" '数据库的文件名
Connstr="DBQ="&server.mappath(""&datapath&""&datafile&"")&";DRIVER={Microsoft Access Driver (*.mdb)};"
SqlNowString="Now()"
end if
ver="2005"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'On Error Resume Next
Set conn=Server.CreateObject("ADODB.Connection")
conn.open ConnStr
If Err Then
err.Clear
Set Conn = Nothing
Response.Write "数据库连接出错,请检查连接字串。"
Response.End
End If
On Error GoTo 0
%>
其实就是这里有一个ID不能为空的句子,and id<>"&newsid&"
去是不能去掉这一句,加上这一句后,就会出错,以前数据库里有内,不会出错,我直接打开数据库删除了里面以前的内容后就报错了,通过后台添加上的也没有,还是报错
问题应该不在你上面这段代码,把你数据库连接的代码贴出来,应该是数据库连接字符串写错了。
Microsoft OLE DB Provider for ODBC Drivers (0x80040E4E)
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
Microsoft OLE DB Provider for SQL Server 求救~~
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
Microsoft OLE DB Service Components 错误 '8000ffff'
Microsoft OLE DB Service Components 错误 '8000ffff'
Microsoft OLE DB Provider for ODBC Drivers (0x80040E2F)
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)