dtmyou在上个帖子中说
引用:
将new.asp中间的<%... %>代码换成如下代码试试
set conn = server.createobject("ADODB.connection")
path = server.MapPath("sakurasky.mdb")
conn.Open "Driver={Microsoft Access Driver (*.mdb)};dbq=" & path
sql="select * from sakurasky order by id asc"
set rs=server.CreateObject("adodb.recordset")
rs.Open sql,conn,1,1
while not rs.EOF
i=i+1
if i>10 then
rs.Delete
exit
end if
wend
rs.movelast
是把代码改为这样吗:
游戏分类<%
set conn = server.createobject("ADODB.connection")
path = server.MapPath("sakurasky.mdb")
conn.Open "Driver={Microsoft Access Driver (*.mdb)};dbq=" & path
sql="select top 1 id from sakurasky order by id"
set rs=conn.execute(sql)
if not rs.eof then
delid=rs("id")
else
delid=0
end if
do while not EOF
i = i + 1
if i > 10 then
dol = "delete from sakurasky where id="&delid
on error resume next
conn.execute (dol)
exit do
end if%>
<%=Rs("time")%> |
<%=Rs("name1")%> |
更新: |
<%=Rs("message")%> |
<%
Rs.movenext
loop
Rs.close
set Rs = nothing
%>
显示:
-----------------------------------------------------------------------------------
ADODB.Recordset 错误 '800a0cc1'
项目在所需的名称或序数中未被发现。
/ice/gb/new.asp,行49
-----------------------------------------------------------------------------------
顺便说一下,行49是:
<%=Rs("time")%>