如何判断字符是否为空,为空则不显示在列表中?
这是在一个分页显示用户意见的列表里面!列表有两列,一列是意见,一列是发表时间!
不知道可不可以判断数据库中的意见列是否为空,为空则不显示这行,直接显示下一条不为空的意见!
页面代码是这样的:
<%
dim conn
dim connstr
on error resume next
set conn=server.createobject( "ADODB.CONNECTION ")
connstr= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & server.MapPath( "###.mdb ")
conn.open connstr
set rs=Server.CreateObject( "ADODB.Recordset ")
sql= "select * from yijian where logs order time sedc“
rs.open sql,conn,3,2
j=rs.recordcount
%>
<!--#include file= "page.asp "-->
<%
dim RowCount
RowCount=10
call Turnpage(rs,RowCount)
%>
<strong> </strong>
<form name= "form1 " method= "post " action= " ">
<table width= "75% " border= "1 " bordercolor= "#CCCCCC ">
<tr>
<td> <div align= "center "> <strong> 用户意见 </strong> </div> </td>
<td> <div align= "center "> <strong> 发布时间 </strong> </div> </td>
</tr>
<%
if not rs.eof then
Do while not rs.eof and RowCount> 0
%>
<tr>
<td width= "80% " bgcolor= "#f5f5f5 "> <div align= "left "> <%=rs( "myyj ")%> </div> </td>
<td width= "20% " bgcolor= "#f5f5f5 "> <div align= "center "> <%=rs( "mytime ")%> </div> </td>
</tr>
<%
RowCount = RowCount - 1
rs.movenext
Loop
end if
%>
<td colspan= "2 "> 共有意见 <font color= "#990000 "> [ <%=j%> </font> ]条 </td>
------解决方案--------------------可直接在
Do while not rs.eof and R