asp:if 语句跳转问题

来源:百度知道 编辑:UC知道 时间:2024/06/24 18:21:33
请各位高手帮忙看看:
set rs3=server.createobject("adodb.recordset")

set rs3=conn.execute("select * from salary where name='"&name&"'")

%>
<div align=center>
<table border=0 cellpadding=3 cellspacing=3 width=553 height=151>
<tr>
<%if not rs3.eof and not rs3.bof then%>

<td width=65 height=1 colspan=2 bgcolor=#c0c0c0>编号 </td>
<td width=1 height=23 bgcolor=#c0c0c0 bordercolor="#FFFFFF"><%=rs3("编号")%></td>

<td width=65 height=1 colspan=2 bgcolor=#c0c0c0>姓名 </td>
<td width=45 height=1 bgcolor=#c0c0c0><%=rs3("name")%></td>

<td width=65 height=1 colspan=2 bgcolor=#c0c0c0>小计 </td>
<td width=3 height=23 bgcolor=#c0c0c0><%=rs3("小计1")%></td>
<td width=65 height=1 colspan=2 bgcolor=#c0c0c0>职务工资(岗位)</td&g

你的用法好像....有些啰嗦了.
<%
set rs3=server.createobject("adodb.recordset") '新建了记录集就可以不这样用了.下面这句改成
'set rs3=conn.execute("select * from salary where name='"&name&"'")
rs3.open "select * from salary where name='"&name&"'",conn,1,3

%>
<%
if rs3.bof and rs3.eof then
response.write "<script>alert('记录为空!');history.back();</script>"
response.end
else
%>
<div align=center>
<table border=0 cellpadding=3 cellspacing=3 width=553 height=151>
<tr>
<td width=65 height=1 colspan=2 bgcolor=#c0c0c0>编号 </td>
<td width=65 height=1 colspan=2 bgcolor=#c0c0c0>姓名 </td>
<td width=65 height=1 colspan=2 bgcolor=#c0c0c0>小计 </td>
<td width=65 height=1 colspan=2 bgcolor=#c0c0c0>职务工资(岗位)</td>
<td width=65 height=1 colspan=2 bgc