请教高手,做个可以后台自定义摸版的新闻页面,读取3个表的数据,可是调用用户数据就说找不到当前记录集
ADODB.Field 错误 '800a0bcd'
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。
/yy/news_view.asp,行 25
代码:
<%
newsid=trim(request("newsid"))
sql = "select * from news where id="&newsid
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,1
title="<font color="&rs("titlecolor")&">"&trim(rs("title"))&"</font>"
webtitle=rs("title")
dat=rs("time")
user=trim(rs("zz"))
hit=rs("hit")+1
hit=hit
webxgnews=rs("xgnews")
if webxgnews="" then webxgnews=left(rs("title"),10)
content=rs("content")
sql3 = "select * from reguser where username='&user&'"
Set rs3 = Server.CreateObject("ADODB.RecordSet")
rs3.Open sql3,conn,1,1
if not rs3.bof or rs3.eof then
username=rs3("username")
userface=rs3("userface")
Purview=rs3("Purview")
score=rs3("score")
LastLogTime=rs3("LastLogTime")
end if
%>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<title><%=webtitle%></title>
<STYLE type="text/css">
<!--
a:link { text-decoration: none; font-family: AdobeSm; color: #000000 }
a:visited { text-decoration: none; color: #000000 }
A:hover {COLOR: green; FONT-FAMILY: "宋体"; TEXT-DECORATION: underline;}
body { font-size: 10.5pt; font-family: 宋体, Arial;color: #000000}
TD {FONT-SIZE: 10.5pt; FONT-FAMILY: "宋体", "Arial";color: #000000}
body { margin-top: 0; margin-bottom: 0; color: #000000 }
-->
</STYLE>
</head>
<%
conn.Execute = "update news set hit='"&rs("hit")+1&"' where ID="&(newsid)
lmid=cint(rs("lm2"))
sql2 = "select * from lm where mb<>'' and id="&lmid
Set rs2 = Server.CreateObject("ADODB.RecordSet")
rs2.Open sql2,conn,1,1
if rs2.recordcount<>0 then
lm=rs2("lm2")
mbid=rs2("mb")
sql4 = "select * from newsmb where id="&mbid
Set rs4 = Server.CreateObject("ADODB.RecordSet")
rs4.Open sql4,conn,1,1
if rs4.recordcount<>0 then
nr=rs4("mid")
nr=replace(nr,"$$标题$$",title)
nr=replace(nr,"$$栏目名$$",lm)
nr=replace(nr,"$$时间$$",dat)
nr=replace(nr,"$$访问量$$",hit)
nr=replace(nr,"$$内容$$",content)
nr=replace(nr,"$$作者$$",username)
nr=replace(nr,"$$头像$$",userface)
nr=replace(nr,"$$权限$$",Purview)
response.write nr
else
response.write "<center><BR><BR><BR>模版设置不正确。"
end if
rs4.close
set rs4=nothing
else
Response.Write "<center><BR><BR><BR>此栏目模版设置不正确"
mbid=1
end if
%>
[此贴子已经被作者于2005-12-26 18:43:55编辑过]