asp如何显示空记录

来源:百度知道 编辑:UC知道 时间:2024/05/29 16:55:38
<%
m_id=trim(request("m_id"))
set rs=server.createobject("adodb.recordset")
sql="select * from mobile where m_id="& m_id
rs.open sql,conn,1,1
%>
<%
set rst=server.createobject("adodb.recordset")
sqltext="select * from mobile,record where mobile.mobile_No=record.mobile_No"
rst.open sqltext,conn,1,1
if rst.bof and rst.eof then
rst.close
set rst=nothing
end if
%>
<table width="760" border="1" align="center" cellpadding="0" cellspacing="1" bordercolor="#CCCCCC">
<tr>
<td colspan="5" background="pic/bg_re.gif" class="pbutton">串号为<%=rs("Mobile_No")%> 手机的详细资料如下:</td>
</tr>
<tr class="p9">
<td width="31%" bgcolor="#e3f1d1"><div align="rig

把这段<%
set rst=server.createobject("adodb.recordset")
sqltext="select * from mobile,record where mobile.mobile_No=record.mobile_No"
rst.open sqltext,conn,1,1
if rst.bof and rst.eof then
rst.close
set rst=nothing
end if
%> 分开,然后把<table>标签内的代码移进去:
<%
set rst=server.createobject("adodb.recordset")
sqltext="select * from mobile,record where mobile.mobile_No=record.mobile_No"
rst.open sqltext,conn,1,1
if rst.bof and rst.eof then
%>

<table width="760 .......</table>

<%
rst.close
set rst=nothing
end if
%>

if rs("xxxx") = "" then
response.write("& nbsp")
else
response.write(rs("xxxx"))
end if