急急。。。版主帮帮我。。数据库的问题

bodytrtd 2010-02-02 04:10:25
<!--#Include File="Inc/Conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>修改为精华 </title>
<link href="css.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.STYLE1 {
font-size: 14px;
font-weight: bold;
}
-->
</style>
</head>

<body>

<!-- #include file="Head1.asp" -->
<table width="1000" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" align="center">
<tr>
<td>
<table width="980" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td height="8" colspan="6"> </td>
</tr>
<tr>
<td colspan="6" bgcolor="#BFBFBF" align="center" height="25"> <span class="STYLE1">修改为精华图片 </span> </td>
</tr> </table>
<%
Dim Action,TitleId,ImageID,score
ImageID=(Request.QueryString("TitleId"))
Set rsw = Server.CreateObject("ADODB.Recordset")
sqlw="select * from Nt_Imgbook" 这里是读取图片的表
rsw.open sqlw,conn,1,3
if not rsw("id")=ImageID then 判断图片的ID是否与request过来图片的id相等 如果相等则显示下表格
%>
<table width="980" border="0" cellspacing="0" cellpadding="0" align="center">
<%
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from nt_score" 这个是设为精华表
rs.open sql,conn,1,3
if rs("imageid")=ImageID then 判断精华表里的imageid是否与request过来图片的id相等 如果相等则显示下表格
%>
<%dim rsa,sqla
Set rsa = Server.CreateObject("ADODB.Recordset")
sqla="select * from nt_score where ImageID="&request("titleid")&"" 这里就是读取表里的信息,条件是表里的imageid是否与request过来图片的id相等
rsa.open sqla,conn,1,3
%>
<form action="xjj?Action=jjl" method="post">
<tr>
<td width="316" height="35" align="right">
图片id:
<input name="id1" type="text" size="10" value=" <%=rsa("ImageID")%>"/> </td>
<td width="136">*图片id不可以改1 </td>
<td width="150" height="35" align="right">
张数: <input name="zs2" type="text" size="10" value=" <%=request("count")%>"/> </td>
<td width="150">*图片张数不可以改1 </td>
<td width="134" height="35" align="right">
得分:
<input name="score1" type="text" size="10" value=" <%=rsa("score")%>"/> </td>
<td width="394">*100分以上为精华图片,如果取消精华的话,填写100以下1 </td>
</tr>
<tr>
<td height="28" colspan="6" align="center"> <input type="submit" name="Submit" value="提交" /> </td>
</tr> </form>
<%rsa.movenext
rsa.close
%>
<%else%> 判断精华表里的imageid是否与request过来图片的id相等 如果不相等则显示下表格

<form action="tjj.asp" method="post">
<tr>
<td width="152" height="35" align="right">
图片id: <input name="id2" type="text" size="10" value=" <%=request("titleID")%>"/> </td>
<td width="150">*图片id不可以改2 </td>
<td width="150" height="35" align="right">
张数: <input name="zs2" type="text" size="10" value=" <%=request("count")%>"/> </td>
<td width="150">*图片张数不可以改2 </td>
<td width="160" height="35" align="right">
得分: <input name="score2" type="text" size="10" value=""/> </td>
<td width="118">*100分以上为精华图片,如果取消精华的话,填写100以下2 </td>
</tr>
<tr>
<td height="28" colspan="6" align="center"> <input type="submit" name="Submit" value="提交" /> </td>
</tr> </form>
<%rs.movenext
end if
rs.close
%>
</table>
<%else%> 如果request过来的id跟图片表不相等则显示
<table width="980" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td height="8" colspan="6"> </td>
</tr>
<tr>
<td colspan="6"align="center" height="25">数据库找不到此图片ID   [ <a href="index.asp">返回首页 </a>] </td>
</tr> </table>
<%rsw.movenext
end if
rsw.close
Set rsw=Nothing
%>
</td>
</tr>
</table>

<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr> <td>
<table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="8"> </td>
</tr>
</table>
<!--db-->
<!-- #include file="footer.asp" -->
(现在的问题是当 rs("imageid")=ImageID 这样写的时候,就显示else那个表格,当rs("imageid") <>ImageID 就显示 <form action="xjj?Action=jjl" method="post">的那个表格,但是当ruquest过来的图片titileid不等于nt_score表里的imageid就出现错误)bof 或sof 有一个是真。。。帮我解决解决。。谢谢啦
...全文
101 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
bodytrtd 2010-02-02
  • 打赏
  • 举报
回复
if not rsw("id")=ImageID then 每个地方都加上这句?
bodytrtd 2010-02-02
  • 打赏
  • 举报
回复
应该是nt_score这个表这里出的问题
bodytrtd 2010-02-02
  • 打赏
  • 举报
回复
你说的那个表是有数据的。。。还要判断?
dean8828 2010-02-02
  • 打赏
  • 举报
回复
数据库里没有数据
所以跟3L一样,加上一条if not rsw("id")=ImageID then
bodytrtd 2010-02-02
  • 打赏
  • 举报
回复
数据库是没有。。
所以我要判断
dolphin1984 2010-02-02
  • 打赏
  • 举报
回复
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。


很有可能是库里没值,确保有数据的说。。
  • 打赏
  • 举报
回复
<!--#Include File="Inc/Conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>修改为精华 </title>
<link href="css.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.STYLE1 {
font-size: 14px;
font-weight: bold;
}
-->
</style>
</head>

<body>

<!-- #include file="Head1.asp" -->
<table width="1000" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" align="center">
<tr>
<td>
<table width="980" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td height="8" colspan="6"> </td>
</tr>
<tr>
<td colspan="6" bgcolor="#BFBFBF" align="center" height="25"> <span class="STYLE1">修改为精华图片 </span> </td>
</tr> </table>
<%
Dim Action,TitleId,ImageID,score
ImageID=(Request.QueryString("TitleId"))
Set rsw = Server.CreateObject("ADODB.Recordset")
sqlw="select * from Nt_Imgbook" 这里是读取图片的表
rsw.open sqlw,conn,1,3
if not rsw("id")=ImageID then 判断图片的ID是否与request过来图片的id相等 如果相等则显示下表格
%>
<table width="980" border
是红色这部分有问题了在没有判断是否有记录的情况下使用?

bodytrtd 2010-02-02
  • 打赏
  • 举报
回复
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。
dean8828 2010-02-02
  • 打赏
  • 举报
回复
浏览器报什么错误?

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧