新手救解:怎么我这段asp代码老提示出错
<%
set conn=server.createobject( "adodb.connection ")
conn.open "driver={Microsoft Access driver (*.mdb)};dbq= "&server.mappath( "/try.mdb ")
set rs=server.createobject( "adodb.recordset ")
exec= "select * from tab "
rs.open exec,conn,1,1
do while not rs.eof
response.write rs( "name ")
rs.movenext
loop
%>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<%
set conn=server.createobject( "adodb.connection ")
conn.open "driver={Microsoft Access driver (*.mdb)};dbq= "&server.mappath( "/try.mdb ")
set rs=server.createobject( "adodb.recordset ")
exec= "select * from tab "
rs.open exec,conn,1,1
do while not rs.eof
response.write rs( "name ")
rs.movenext
loop
%>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
目录下已经建好access数据库try.mdb,引用表tab,字段分别为name,sex,lover.
用asp调试工具调试老出错.提示出错内容:
response.write rs( "name ")
rs.movenext
loop
Response.Write " " & vbCrLf[0]Script error detected at line 6,col[0].
Description: 在对应所需名称或序数的集合中,未找到项目。
请高手帮帮忙看看是什么问题.多谢.
------解决方案--------------------在对应所需名称或序数的集合中,未找到项目
--------------------------
未找到项目,检查一下连接字符串,还有是否有表和那字段
------解决方案-------------------- "在对应所需名称或序数的集合中,未找到项目 "这个错误一般都是表名或字段名错误