浴火银河2武器m6a4:关于asp的问题

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/29 21:02:42
<%if request("save")="" and request("a")="" then%>
<%dim place,rksl,money,spbfb,ylbfb,jjbfb,bjbfb
If Len(Trim(Request("page")))=0 Then '返回目标页码的判断
page=1
Else
page=CInt(Trim(Request("page")))
End If
set rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from [QYQL] "
rs.open sql,conn,1,1
rs.PageSize=4
if rs.eof then%><center>暂时没有资料!</center> </td>
</tr>
<%else%>
<%if not rs.eof then
rs.AbsolutePage=page
for k=1 to rs.PageSize%>
<td width=10%>区域名称</td>
<td><%=rs("place")%></td>
<td width=10%>人口数量</td>
<td><%=rs("rksl")%></td>
<td width=10%>平均收入</td>
td><%=rs("money")%></td>
<td width=10%>可支配收入中用于食品的百分比</td>
<td><%=rs("spbfb")%></td>
<td width=10%>食品支出用于饮料的平均百分比</td>
<td><%=rs("ylbfb")%></td>
<td width=10%>饮料支出用于酒精饮料的平均百分比</td>
<td><%=rs("jjbfb")%></td>
<td width=10%>含酒精饮料支出用于白酒的平均百分比</td>
<td><%=rs("bjbfb")%></td>
<td height=23 width="80%" align="left">
<p align="right"><font color="#0066FF">
</font><font color="#FF0000"><a href="admin_book2.asp? place=<%=rs("place")%>&a=b"><font color="#0066FF">删除</font></a></font><font color="#0066FF"></font></td>
</tr>
<td height=23 width="99%" colspan="2" >
<p align="right"><%
rs.movenext
if rs.EOF Then Exit For
next
end if
%>
<div align=right>
<%
if page <>1 then
Response.Write "<a href=admin_book2.asp?page=1>首页</a> "
end if
tmppage = page - 1
if tmppage <= 0 then
tmppage = 1
else
Response.Write"<a href=admin_book2.asp?page="&tmppage&">上一页</a>"
end if
tmppage = page + 1
if tmppage >rs.PageCount then
tmppage = page
else
Response.Write " <a href=admin_book2.asp?page="&tmppage&">下一页</a> "
end if
if Cstr(page) <> Cstr(rs.PageCount) and Cstr(rs.PageCount) <> 0 then
Response.Write "<a href=admin_book2.asp?page="&rs.PageCount&">尾页</a>"
end if
if Cstr(rs.PageCount) <> 0 then
Response.Write " 每页显示<font color=red>4</font>条留言 第<font color='blue'>" & page & "/"&rs.PageCount&"</font>页"
end if
Response.Write " 共有<font color='blue'>"&rs.RecordCount&"</font>条记录"
end if
rs.close
%><%end if%> </td>
</tr>
</table>
</div>
<%if request("a")="a" then
set rs=server.createobject("adodb.recordset")
sql="delete from QYQL where place="&(request("place"))&""
rs.open sql,conn,1,3
response.write"<script>alert('资料删除成功');location.href='admin_book2.asp';</script>"
rs.close
end if%>
</body>
</html>
点删除出现以下问题:
错误类型:
Microsoft OLE DB Provider for SQL Server (0x80040E14)
第 1 行: '=' 附近有语法错误。
/web/files/admin_book.asp, 第 126 行

sql="delete from QYQL where place='"&(request("place"))&"'"

MicrosoftOLEDBProviderforODBCDrivers(0x80040E14)-->sql语句出错(字段名错误,或数据类型不匹配)

去掉if not rs.eof then

这句
if request("a")="a" then
似乎得改成
if request("a")="b" then