回复:(可见光)[求助]怎么总是报错?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<!--#include file="conn.asp"-->
<%
spxl=request("spxl")
set rs=server.CreateObject("adodb.recordset")
sqltest="select *from Product"
if request("Product_Name")<>"" then
sqltext=sqltext&"where Product_Name like'%"&request("Product_Name")&"%'"
else
sqltext=sqltext&"where Product_Name like'%"&""&"%'"
end if
if request("Product_Class")<>"" then
sqltext=sqltext&"and Class_1 like '%"&request("Product_Class")&"%'"
end if
rs.open sqltext,conn,1,1
'----出错处dim MaxPerpage
MaxPerPage=9
dim text,checkpage
text="0123456789"
Rs.Pagesize=MaxPerpage
for i=1 to len(request("page"))
checkpage=instr(1,text,mid(request("page"),i,1))
if checkpage=0 then
exit for
end if
next
if checkpage<>0 then
if not Isempty(request("page"))then
CurrentPage=Cint(request("page"))
if CurrentPage<1 then CurrentPage=1
if CurrentPage>Rs.PageCount then CurrentPage=Rs.PageCount
else
CurrentPage=1
end if
if not Rs.eof then Rs.AbsolutePage=CurrentPage end if
else
CurrentPage=1
end if
%>
<script>
function openbag(id)
{windows.open("eshop.asp?cpbm="+id,"","height=200,width=700,left=190,top=0,reszable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");}
</script>
<%
if rs.eof and rs.bof then
response.Write"<td><p align='center'><font color='#ff0000'>没有符合条件的cd</font></p></td>"
response.end
end if
%>
<%
row_count=1
Sub list()
%>
<% i=0
Do While Not Rs.Eof
%>
<tr>
<td width="16%" align="center" height="28" bgcolor="#CCCCCC">
<%=rs("Product_Id")%>
</td>
<td width="34%" align="center" height="28" bgcolor="#CCCCCC">
<%=rs("Product_Name")%>
</td>
<td width="18%" align="center" height="28" bgcolor="#CCCCCC">
<%=rs("P_NewPrice")%>
</td>
<td width="17%" align="center" height="28" bgcolor="#CCCCCC">
<a href="spjj.asp?ProductNO=<%=rs("Product_No")%>">详细资料</a>
</td>
<td width="15%" align="center" height="28" bgcolor="#CCCCCC">
<a href='javascript:openbag("<%=rs("Product_Id")%>)'><img style="cursor:hand " src="image/mybuy.gif" width="35" height="12" border="0" align="absmiddle"></a>
</td>
</tr>
<%
i=i+1
if i>=MaxPerpage then exit do
rs.MoveNext
loop
end Sub
%>
</body>
</html>
因为初学,问题会多一些!请大家多多包涵.....
小弟还有一个问题就是
Microsoft JET Database Engine (0x80040E14)
无效的 SQL语句;期待 'DELETE'、'INSERT'、'PROCEDURE'、'SELECT'、或 'UPDATE'。
/spss.asp, 第 22 行
怎么我发的代码总是堆在一块啊
[此贴子已经被作者于2007-8-11 6:58:24编辑过]