if action="" then%>
<form name=ddyx action=ddyx.asp method=post>
<table width="579" border="1" cellpadding="0" cellspacing="0" bordercolorlight="#808080" bordercolor="#FFFFFF" bordercolordark="#FFFFFF" style="table-layout:fixed;word-break:break-all">
<tr>
<td align=center width=12%>顾客姓名</td>
<td align=center width=13%>顾客邮件</td>
<td align=center width=28%>顾客单位</td>
<td align=center width=11%>顾客电话</td>
<td align=center width=11%>顾客手机</td>
<td align=center width=13%>其他联系方式</td>
<td align=center width=12%>感兴趣产品</td>
</tr>
<%
dim rs,msg_per_page
dim sql
msg_per_page = 10 '每页显示记录数
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from dingdang"
rs.cursorlocation = 3
rs.pagesize = msg_per_page '每页显示记录数
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<tr><td colspan=6 align=center height=50>暂时没有留言</td></tr>"
end if
if not (rs.eof and rs.bof) then '检测记录集是否为空
totalrec = RS.RecordCount '总记录条数
if rs.recordcount mod msg_per_page = 0 then '计算总页数,recordcount:数据的总记录数
n = rs.recordcount\msg_per_page 'n:总页数
else
n = rs.recordcount\msg_per_page+1
end if
currentpage = request("page") 'currentpage:当前页
If currentpage <> "" then
currentpage = cint(currentpage)
if currentpage < 1 then
currentpage = 1
end if
if err.number <> 0 then
err.clear
currentpage = 1
end if
else
currentpage = 1
End if
if currentpage*msg_per_page > totalrec and not((currentpage-1)*msg_per_page < totalrec)then
currentPage=1
end if
rs.absolutepage = currentpage 'absolutepage:设置指针指向某页开头
rowcount = rs.pagesize 'pagesize:设置每一页的数据记录数
dim i
dim k
Do while not rs.eof and rowcount>0
UserName=rs("UserName")
usermail=rs("usermail")
danwei=rs("dangwei")
dianhua=rs("dianhua")
shouji=rs("shouji")
qq=rs("qq")
changping=rs("changping")
Response.write "<tr><td align=center>"&UserName&""
Response.write "</td><td align=center>"&usermail&""
Response.write "</td><td align=center>"&dangwei&""
Response.write "</td><td align=center>"&dianhua&""
Response.write "</td><td align=center>"&shouji&""
Response.write "</td><td align=center>"&qq&""
Response.write "</td><td align=center>"&changping&""
Response.write "</td></tr>"
rowcount=rowcount-1
rs.movenext
loop
end if
rs.close
conn.close
set rs=nothing
set conn=nothing
%>
</table>
</form>
显示结果如下:
当单元格内记录为空时,连表格线都没有看到,大家知道为什么会出现这种情况吗?
谢谢!!!!