大家帮我看看代码有误么?

factorymain 2009-06-06 04:22:58
<form action="pl_edit_save.asp" method="post" name="form2" id="form2">
<table width="850" align="center">
<tr bgcolor="#CCCCCC">
<td><div align="center">部门</div></td>
<td><div align="center">姓名</div></td>
<td><div align="center">
<p>银行帐号</p>
</div></td>
<td><div align="center">
<p>胸卡编号</p>
</div></td>
</tr>


<%
bm=request("bm")
set rs =Server.CreateObject("adodb.recordset")
sql="select * from info where 部门="&bm&
rs.open sql,conn,1,1
if rs.eof then
Response.Write "没有记录"
else

proCount=rs.recordcount
rs.PageSize=20
if not IsEmpty(Request("ToPage")) then
ToPage=CInt(Request("ToPage"))
if ToPage>rs.PageCount then
rs.AbsolutePage=rs.PageCount
intCurPage=rs.PageCount
elseif ToPage<=0 then
rs.AbsolutePage=1
intCurPage=1
else
rs.AbsolutePage=ToPage
intCurPage=ToPage
end if
else
rs.AbsolutePage=1
intCurPage=1
end if
intCurPage=CInt(intCurPage)
For i = 1 to rs.PageSize
if rs.EOF then
Exit For
end if '利用for next 循环依次读出记录
%>

<tr onMouseOver=this.style.backgroundColor='#B5E9FD' onMouseOut=this.style.backgroundColor=''>
<td>
<input name="bm" type="text" id="bm" value="<% response.write rs("部门") %>" />
<td><input name="xm" type="text" id="xm" value="<% response.write rs("姓名") %>" />
<td><input name="zh" type="text" id="zh" value="<% response.write rs("帐号") %>" />
<td><input name="xkbh" type="text" id="xkbh" value="<% response.write rs("胸卡编号") %>" />
</tr>

<%
rs.MoveNext
next%>
<tr>
</tr>
</table>


</form>
...全文
35 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
tian_ya2 2009-06-07
  • 打赏
  • 举报
回复
又学习了一招
factorymain 2009-06-06
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 wushaowu 的回复:]
这里明显错误:

sql="select * from info where 部门="&bm&

正确的写法是:

sql="select * from info where 部门='"&bm& "'"
[/Quote]
刚才帖错了,忘了保存就贴出来了,除了这个还有别的么?
wushaowu 2009-06-06
  • 打赏
  • 举报
回复
这里明显错误:

sql="select * from info where 部门="&bm&

正确的写法是:

sql="select * from info where 部门='"&bm& "'"
factorymain 2009-06-06
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 oiuafsai 的回复:]
沙发.
[/Quote]
你的速度也太快了

28,406

社区成员

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

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