| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 536 人关注过本帖
标题:出现这个问题是什么原因??
只看楼主 加入收藏
枫中的峻叶
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2006-9-27
收藏
 问题点数:0 回复次数:9 
出现这个问题是什么原因??

错误类型:
Microsoft JET Database Engine (0x80040E14)
语法错误 (操作符丢失) 在查询表达式 'cataid=' 中。
/shenke/news.asp, 第 120 行


<%

set rs=server.createobject("adodb.recordset")
sql8="select * from news Where cataid= "& Nclassid &" order by id desc"
rs.open sql8,objConn,1,1 在页面中这里是第120行
If rs.Bof Or rs.Eof Then
Response.Write "This is not nothing!"
%>
<%

Else
if not isempty(request("page")) then
pagecount=cint(request("page"))
else
pagecount=1
end if
rs.pagesize=18
if pagecount>rs.pagecount or pagecount<=0 then
pagecount=1
end if
rs.AbsolutePage=pagecount
i=1
Do while not rs.eof and i<=rs.pagesize

%>

2006-10-23 10:55
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
Nclassid的值为空,检查接收到值没有。
2006-10-23 10:58
枫中的峻叶
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2006-9-27
收藏
得分:0 
要说得具体点俺是刚起步的.

2006-10-23 11:04
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 

Nclassid这个变量没有接到值。

sql8="select * from news Where cataid= "& Nclassid &" order by id desc"
把这条语句下面的值先暂时注释掉,然后再在这条语句下面加一语句。
Response.Write sql8
看看SQL语句是否正确显示出来了。

2006-10-23 11:25
chzh22
Rank: 1
等 级:新手上路
帖 子:129
专家分:0
注 册:2006-6-3
收藏
得分:0 
sql8="select * from news Where cataid= "& request("Nclassid") &" order by id desc"
可解决此问题

爱我的人教我温柔;恨我的人教我谨慎;对我冷漠的人教我自立.
2006-10-23 14:56
枫中的峻叶
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2006-9-27
收藏
得分:0 
谢了.

2006-10-24 16:32
枫中的峻叶
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2006-9-27
收藏
得分:0 
没解决.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp" -->
<!--#include file=conn2.asp-->
<% Nclassid=request.QueryString("Nclassid") %>
<%
Sub page(par)
response.Write("<table width='97%' border='0' align='left' class='hongda'> ")
response.Write("<tr>")
response.Write("<td align='left'>")
if rs.pagecount>1 then
response.Write "现为第"&pagecount&"页/共 "&rs.pagecount&"页&nbsp;&nbsp;"
if pagecount>=10 then
response.write"<a href="&par&"?Nclassid="&request("Nclassid")&"&page="&(((cstr(pagecount)\10)-1)*10)+1&">UP</a>&nbsp;"
end if
q=(cstr(pagecount)-1)\10
if q<0 then
q=1
end if
p=(q*10)+1
do while p<((q*10)+11)
If p=pagecount Then
Response.Write p & "&nbsp"
Elseif p<=rs.pagecount then
Response.Write "<a href='"&par&"?Nclassid="&request("Nclassid")&"&page="&p&"'>"&p&"</a>&nbsp"
End If
p=p+1
loop
A=rs.pagecount
if (A mod 10)=0 then
A=rs.pagecount-1
end if
if pagecount<(A\10)*10 then
response.write"<a href="&par&"?Nclassid="&request("Nclassid")&"&page="&((((cstr(pagecount)-1)\10)+1)*10)+1&">NEXT</a>"
end if
End If
response.Write("</td>")
response.Write("</tr>")
response.Write("</table>")
End Sub
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>浙江申科滑动轴承有限公司--公司主要生产交直流电机、汽轮发电机、汽轮机、水轮机、风机、水泵、压缩机及其他旋转机器用的轴承</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-image: url();
}
-->
</style>
<link href="css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
a:link {
color: #990000;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #990000;
}
a:hover {
text-decoration: underline;
color: #666666;
}
a:active {
text-decoration: none;
}
-->
</style></head>

<body>
<table width="1003" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/NEWS_1.jpg" width="1003" height="118"></td>
</tr>
</table>
<table width="1003" border="0" align="center" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="293"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><img src="images/NEWS_2.jpg" width="293" height="102" border="0" usemap="#Map"></td>
</tr>
<tr>
<td height="405" valign="top" background="images/NEWS_7.jpg"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="293" height="405">
<param name="movie" value="fla/hg.swf">
<param name="quality" value="high">
<embed src="fla/hg.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="293" height="405"></embed>
<param name="wmode" value="transparent">
</object></td>
</tr>
</table></td>
<td background="images/NEWS_11.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/NEWS_3.jpg" width="710" height="94"></td>
</tr>
</table> <table width="100%" height="405" border="0" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="230" align="right"><img src="images/NEWS_5.jpg" width="186" height="261"></td>
<td width="455"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="10">&nbsp;</td>
<td width="445" valign="top"><table width="100%" height="29" border="0" align="center" cellpadding="0" cellspacing="0" class="www">
<tr>
<td height="14" class="fff">新闻标题</td>
<td width="19%" align="left" class="fff">查看次数</td>
</tr>
<tr>
<td height="3" colspan="2"></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="lianzhou">
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0" class="hongda">
<%

set rs=server.createobject("adodb.recordset")
sql8="select * from news Where cataid="& request("Nclassid") &" order by id desc"
rs.open sql8,objConn,1,1
If rs.Bof Or rs.Eof Then
Response.Write "This is not nothing!"
%>
<%

Else
if not isempty(request("page")) then
pagecount=cint(request("page"))
else
pagecount=1
end if
rs.pagesize=18
if pagecount>rs.pagecount or pagecount<=0 then
pagecount=1
end if
rs.AbsolutePage=pagecount
i=1
Do while not rs.eof and i<=rs.pagesize

%>
<tr>
<td width="77%" valign="top" class="ddd"><a href='index1_news.asp?id=<%=rs("id")%>&Nclassid=<%=rs("cataid")%>' target="_blank" class="a1"><%=rs("title")%></a> </td>
<td width="23%" valign="top" class="ddd">[已被查看<%=rs("hits")%>次]</td>
</tr>
<%
i=i+1
rs.movenext
Loop
End If
%>
</table>
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" class="ddd"><%Call page("index9.asp")%></td>
</tr>
</table></td>
</tr>
<%
rs.close
set rs=nothing
objConn.close
set objConn =nothing
%>
</table></td>
</tr>
</table>
</td>
<td bgcolor="#FFFFFF">&nbsp;</td>
</tr>
</table></td>
</tr>
</table>
<table width="1003" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/NEWS_9.jpg" width="1003" height="48"></td>
</tr>
</table>
<map name="Map">
<area shape="rect" coords="84,32,267,52" href="news.asp">
<area shape="rect" coords="83,59,268,79" href="news-hy.asp">
</map>
</body>
</html>

2006-10-24 16:35
hangxj
Rank: 6Rank: 6
等 级:贵宾
威 望:29
帖 子:2045
专家分:0
注 册:2006-4-10
收藏
得分:0 
你学到了什么呢?
如果没有思考去来为什么,我想,这是没有任何意义的.

http://www./
2006-10-24 16:42
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
还没解决就可能问题没有出在这个地方,上一个页面。
2006-10-24 21:34
枫中的峻叶
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2006-9-27
收藏
得分:0 
<%

set rs=server.createobject("adodb.recordset")
sql8="select * from news Where cataid=12 order by id desc"
rs.open sql8,objConn,1,1 在页面中这里是第120行
If rs.Bof Or rs.Eof Then
Response.Write "This is not nothing!"
%>


这样就OK了.

2006-10-25 13:23
快速回复:出现这个问题是什么原因??
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014998 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved