Microsoft JET Database Engine 错误 '80040e14' 语法错误 (操作符丢失) 在查询表达式 'ns_id=' 中。
--------------------编程问答-------------------- <% '新闻内容Function news_content()
dim Rst
set rs=server.CreateObject("ADODB.RECORDSET")
SQL="select * from bdnews where nws_id="&request.QueryString("id")&""
rs.open sql ,cn,1,3
if rs.eof then
Rst=Rst&"暂无信息"
else
' Rst=Rst&"<font size=3><strong>"&rs(1)&"</strong></font><hr size=1 color=#e2e2e2 width='100%'><br>"
Rst=Rst&"<div align=left>"&rs("nws_cont")&"</div>"
end if
rs.close
set rs=nothing
news_content=Rst
End Function
%>
<%'新闻标题
Function news_title()
set rs=server.CreateObject("ADODB.RECORDSET")
SQL="select * from bdnews where nws_id="&request.QueryString("id")&""
rs.open sql ,cn,1,3
if rs.eof then
Rst=Rst&"暂无信息"
else
' Rst=Rst&"<font size=3><strong>"&rs(1)&"</strong></font><hr size=1 color=#e2e2e2 width='100%'><br>"
Rst=Rst&rs("nws_title")
end if
rs.close
set rs=nothing
news_title=Rst
End Function
%>
<% '产品列表
function pro(canshu,yeshu,hang,lie,url)
dim jzlx
jzlx=request.QueryString("zlx")
page=Request.QueryString("page")
If page="" Then page="1"
page=Cint(page)
Set rs = Server.CreateObject("Adodb.RecordSet")
if jzlx="" then
sql="select * from bdcp order by cxp_id desc"' where cb_id="&canshu&"
else
sql="select * from bdcp where cs_id="&request.QueryString("zlx")&" order by cxp_id desc"
end if
rs.cursorlocation=3
rs.open sql,cn,2,3
rs.PageSize=yeshu
tcount=rs.RecordCount
tpage=rs.PageCount
If rs.Bof And rs.Eof Then
Rst="<br><p><Center><font color=red>无相关信息!</font><br><br></Center>"
Else
Rst=Rst&"<table width=99% border=0 align=center cellpadding=0 cellspacing=0>"
rs.Move (page-1)*rs.pagesize
For i = 1 to hang
Rst=Rst&"<tr align=center valign=top>"
For j = 1 to lie
If rs.Eof Then Exit For
Rst=Rst&"<td>"
If not rs.Eof then
Rst=Rst&"<table border=0><tr><td align=center><table width=96% border=0 cellspacing=0 cellpadding=0><tr><td></td><td height=5></td><td></td></tr><tr><td colspan=3 align=center><a href="&url&"?id="&rs(0)&" target=_blank><img src="&mid(rs("fileurl"),7)&" width=165 height=150 border=0 /></a></td></tr><tr><td colspan=3 align=center height=30><a href="&url&"?id="&rs(0)&" target=_blank>【"&left(rs(1),6)&"】</a></td></tr></table></td></tr></table>"
end if
Rst=Rst&"</td>"
rs.MoveNext
Next
Rst=Rst&"</tr>"
Next
Rst=Rst&"</table>"
Rst=Rst&"<center><span>"
If page>1 Then
Rst=Rst&"<a href=?page=1&zlx="&server.URLEncode(jzlx)&">第一页</a> "
Rst=Rst&"<a href=?page="&page-1&"&zlx="&server.URLEncode(jzlx)&">上一页</a> "
Else
Rst=Rst&"<span>第一页 上一页 </span>"
End If
If page<tpage Then
Rst=Rst&"<a href=?page="&page+1&"&zlx="&server.URLEncode(jzlx)&">下一页</a> "
Rst=Rst&"<a href=?page="&tpage&"&zlx="&server.URLEncode(jzlx)&">最后一页</a> "
--------------------编程问答-------------------- Else
Rst=Rst&"下一页 最后一页"
End If
Rst=Rst&" 当前页 ["&page&"/"&tpage&"]</span>"
Rst=Rst&"</center>"
End if
lastpage=Cint(tpage)
pro=Rst
end function
%>
<% '产品内容
Function pro_content()
Dim Rst
set rs=server.CreateObject("ADODB.RECORDSET")
SQL="select * from bdcp where cxp_id="&request.QueryString("id")&""
rs.open sql ,cn,1,3
if rs.eof then
Rst=Rst&"暂无信息"
else
Rst=Rst&"<center><font size=3><strong>"&rs(1)&"</strong><font></center><br>"
Rst=Rst&"<div align=left>"&rs("cxp_cont")&"</div>"
end if
rs.close
set rs=nothing
pro_content=Rst
End Function
%>
<% '成功案例
function cases(canshu,yeshu,hang,lie,url)
dim jzlx
jzlx=request.QueryString("zlx")
page=Request.QueryString("page")
If page="" Then page="1"
page=Cint(page)
Set rs = Server.CreateObject("Adodb.RecordSet")
if jzlx="" then
sql="select * from bdnews where nb_id="&canshu&" order by nws_id desc"
else
sql="select * from bdnews where ns_id="&request.QueryString("zlx")&" order by nws_id desc"
end if
rs.cursorlocation=3
rs.open sql,cn,2,3
rs.PageSize=yeshu
tcount=rs.RecordCount
tpage=rs.PageCount
If rs.Bof And rs.Eof Then
Rst="<br><p><Center><font color=red>无相关信息!</font><br><br></Center>"
Else
Rst=Rst&"<table width=99% border=0 align=center cellpadding=0 cellspacing=0>"
rs.Move (page-1)*rs.pagesize
For i = 1 to hang
Rst=Rst&"<tr align=center valign=top>"
For j = 1 to lie
If rs.Eof Then Exit For
Rst=Rst&"<td>"
If not rs.Eof then
Rst=Rst&"<table border=0><tr><td align=center><table width=96% border=0 cellspacing=0 cellpadding=0><tr><td></td><td height=5></td><td></td></tr><tr><td colspan=3 align=center><a href="&url&"?id="&rs(0)&" target=_blank><img src="&mid(rs("fileurl"),7)&" width=170 height=150 border=0 /></a></td></tr><tr><td colspan=3 align=center height=30><a href="&url&"?id="&rs(0)&" target=_blank>【"&left(rs(1),6)&"】</a></td></tr></table></td></tr></table>"
end if
Rst=Rst&"</td>"
rs.MoveNext
Next
Rst=Rst&"</tr>"
Next
Rst=Rst&"</table>"
Rst=Rst&"<center><span>"
If page>1 Then
Rst=Rst&"<a href=?page=1&zlx="&server.URLEncode(jzlx)&">第一页</a> "
Rst=Rst&"<a href=?page="&page-1&"&zlx="&server.URLEncode(jzlx)&">上一页</a> "
Else
Rst=Rst&"<span>第一页 上一页 </span>"
End If
If page<tpage Then
Rst=Rst&"<a href=?page="&page+1&"&zlx="&server.URLEncode(jzlx)&">下一页</a> "
Rst=Rst&"<a href=?page="&tpage&"&zlx="&server.URLEncode(jzlx)&">最后一页</a> "
Else
Rst=Rst&"下一页 最后一页"
End If
Rst=Rst&" 当前页 ["&page&"/"&tpage&"]</span>"
Rst=Rst&"</center>"
End if
lastpage=Cint(tpage)
cases=Rst
end function
%>
<% '产品列表--带条件 %>
<%
function pro111(sel,sel1,url)
dim jzlx
jzlx=request.QueryString("zlx")
page=Request.QueryString("page")
If page="" Then page="1"
page=Cint(page)
Set rs = Server.CreateObject("Adodb.RecordSet")
if jzlx="" then
sql="select * from bdnews where nb_id=192 order by nws_id desc"
else
sql=""&sel1&""
end if
rs.cursorlocation=3
rs.open sql,cn,2,3
rs.PageSize=4
tcount=rs.RecordCount
tpage=rs.PageCount
If rs.Bof And rs.Eof Then
Rst="<p><Center><font color=red>无相关信息!</font><br><br></Center>"
Else
Rst=Rst&"</br><table width=99% border=0 align=center cellpadding=0 cellspacing=0>"
rs.Move (page-1)*rs.pagesize
For i = 1 to 2
Rst=Rst&"<tr align=center valign=top>"
For j = 1 to 2
--------------------编程问答-------------------- If rs.Eof Then Exit For
Rst=Rst&"<td>"
Rst=Rst&"<table width=176 border=0><tr><td align=center><table width=100% border=0 cellspacing=0 cellpadding=0><tr><td></td><td height=5></td><td></td></tr><tr><td colspan=3 align=center><a href="&url&".asp?id="&rs(0)&" target=_blank class=highlightit><img src="&mid(rs("fileurl"),7)&" width=220 height=180 border=0 /></a></td></tr><tr><td></td><td height=5></td><td></td></tr></table></td></tr><tr><td align=center valign=middle><a href="&url&".asp?id="&rs(0)&" class=intr02>【"&left(rs(1),8)&"】</a></td></tr></table>"
Rst=Rst&"</td>"
rs.MoveNext
Next
Rst=Rst&"</tr>"
Next
Rst=Rst&"</table></br>"
Rst=Rst&"<center><span class=intr02>"
If page>1 Then
Rst=Rst&"<a href=?page=1&zlx="&server.URLEncode(jzlx)&" class=intr02>第一页</a>"
Rst=Rst&"<a href=?page="&page-1&"&zlx="&server.URLEncode(jzlx)&" class=intr02>上一页</a> "
Else
Rst=Rst&"<span class=intr02>第一页 上一页</span>"
End If
If page<tpage Then
Rst=Rst&"<a href=?page="&page+1&"&zlx="&server.URLEncode(jzlx)&" class=intr02>下一页</a>"
Rst=Rst&"<a href=?page="&tpage&"&zlx="&server.URLEncode(jzlx)&" class=intr02>最后一页</a>"
Else
Rst=Rst&"下一页 最后一页"
End If
Rst=Rst&" 当前页 ["&page&"/"&tpage&"]</span>"
Rst=Rst&"</center></br>"
End if
lastpage=Cint(tpage)
pro111=Rst
end function
%>
<% '产品 类 列表 无分页 %>
<%
function pro_class(sel)
dim jzlx
jzlx=request.QueryString("zlx")
page=Request.QueryString("page")
If page="" Then page="1"
page=Cint(page)
Set rs = Server.CreateObject("Adodb.RecordSet")
sql=""&sel&""
rs.cursorlocation=3
rs.open sql,cn,2,3
rs.PageSize=200
tcount=rs.RecordCount
tpage=rs.PageCount
If rs.Bof And rs.Eof Then
Rst="<p><Center><font color=red> </font><br><br></Center>"
Else
Rst=Rst&"<table border=0 align=center cellpadding=0 cellspacing=0>"
rs.Move (page-1)*rs.pagesize
For i = 1 to 20
Rst=Rst&"<tr align=center valign=top height=0>"
For j = 1 to 5
If rs.Eof Then Exit For
Rst=Rst&"<td height=0 align=left with=100>"
Rst=Rst&"<a href="&rs("F_url")&" target=_blank>"&rs("F_title")&"</a>"
Rst=Rst&"</td>"
rs.MoveNext
Next
Rst=Rst&"</tr>"
Next
Rst=Rst&"</table>"
End if
pro_class=Rst
end function
%>
<%'下载
function xiazai(canshu,yeshu,hang,lie,url)
dim jzlx
jzlx=request.QueryString("zlx")
page=Request.QueryString("page")
If page="" Then page="1"
page=Cint(page)
Set rs = Server.CreateObject("Adodb.RecordSet")
if jzlx="" then
sql="select * from bdnews where nb_id="&canshu&" order by nws_id desc"
else
sql="select * from bdnews where ns_id="&request.QueryString("zlx")&" order by nws_id desc"
end if
rs.cursorlocation=3
rs.open sql,cn,2,3
rs.PageSize=yeshu
tcount=rs.RecordCount
tpage=rs.PageCount
If rs.Bof And rs.Eof Then
Rst="<p><Center><font color=red>无相关信息!</font><br><br></Center>"
Else
Rst=Rst&"<table width=99% border=0 align=center cellpadding=0 cellspacing=0>"
rs.Move (page-1)*rs.pagesize
For i = 1 to hang
Rst=Rst&"<tr align=center valign=top>"
For j = 1 to lie
If rs.Eof Then Exit For
Rst=Rst&"<td>"
Rst=Rst&"<table width='100%' border=0 class='about_info'><tr><td width='11%'> </td><td width='86%'>文件名:<a href="&mid(rs("fileurl"),7)&">"&rs(1)&"</a></td></tr><tr><td> </td><td>"&rs("nws_cont")&"</td></tr><tr><td> </td><td> </td></tr></table>"
Rst=Rst&"</td>"
rs.MoveNext
Next
Rst=Rst&"</tr>"
Next
Rst=Rst&"</table>"
Rst=Rst&"<center><span>"
If page>1 Then
Rst=Rst&"<a href=?page=1&zlx="&server.URLEncode(jzlx)&">第一页</a>"
Rst=Rst&"<a href=?page="&page-1&"&zlx="&server.URLEncode(jzlx)&">上一页</a> "
Else
Rst=Rst&"<span class=>第一页 上一页</span>"
End If
If page<tpage Then
Rst=Rst&"<a href=?page="&page+1&"&zlx="&server.URLEncode(jzlx)&">下一页</a>"
Rst=Rst&"<a href=?page="&tpage&"&zlx="&server.URLEncode(jzlx)&">最后一页</a>"
Else
Rst=Rst&"下一页 最后一页"
End If
Rst=Rst&" 当前页 ["&page&"/"&tpage&"]</span>"
Rst=Rst&"</center>"
End if
lastpage=Cint(tpage)
xiazai=Rst
end function
%>
<%
sub product_class(id)
set rs=cn.execute("select * from csclass where cs_id="&id)
if not rs.eof then
Response.Write(rs("cs_name"))
end if
end sub
%> --------------------编程问答-------------------- asp怎么发到这里了?
不用看你这么多代码
就两行
Rst=Rst&"<a href=?page="&page+1&"&zlx="&server.URLEncode(jzlx)&">下一页</a>"
ns_id="&request.queryString("s")&"
下一页都没有s参数 你接收个啥啊? 空值 当然ns_id='' 怎么查询?
下一页链接把s参数传过去就行了 --------------------编程问答-------------------- 你好,我对这个不懂,可以帮我改改吗?
谢谢
补充:.NET技术 , ASP.NET