asp错误。。好心人进

来源:百度知道 编辑:UC知道 时间:2024/06/17 04:50:44
<%
set conn=server.createobject("adodb.connection")

conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("../db/ex.mdb")

%>
<%
exec="select * from table"
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<%do while not rs.eof%><tr>
<td><%=rs("username")%></td>
<td><%=rs("tel")%></td>
<td><%=rs("message")%></td>
<td><%=rs("time")%></td>
</tr><%
rs.movenext
loop
%>

错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E21)
ODBC 驱动程序不支持所需的属性。
/web/index.asp, 第 10 行
我把表换了个名字又出现这错误
exec="select * from

<%
dim conn,db
dim connstr
db="../db/ex.mdb"
on error resume next
connstr="DBQ="+server.mappath(""&db&"")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
if err then
err.clear
else
conn.open connstr
end if
sub CloseConn()
conn.close
set conn=nothing
end sub
%>
<%
exec="select * from table"
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<%do while not rs.eof%><tr>
<td><%=rs("username")%></td>
<td><%=rs("tel")%></td>
<td><%=rs("message")%></td>
<td><%=rs(&qu