永发信息网

无法正确读取ACCESS数据库

答案:2  悬赏:60  手机版
解决时间 2021-05-06 02:09
  • 提问者网友:我没有何以琛的痴心不悔
  • 2021-05-05 23:11

<!--#include file="conn.asp"-->

<!-- #include file="Head.asp" -->
<script language="javascript">
function confirmdel(id,page){
if (confirm("真的要删除吗?"))
window.location.href="Delorderlist1.asp?id="+id+"&page="+page
}
</script>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top"> <br> <strong><br>
</strong> <table width="560" border="0" cellpadding="2" cellspacing="1" class="table_southidc">
<tr>
<td class="back_southidc" height="25"><div align="center"><strong>汇款管理<br>
</strong></div></td>
</tr>
<tr>
<td height="16">
<%
flag="尚未处理"
set rs=server.createobject("adodb.recordset")
sqltext="select * from service order by id1 desc"
rs.open sqltext,conn,1,1

dim MaxPerPage
MaxPerPage=20

'取得页数,并判断用户输入的是否数字类型的数据,如不是将以第一页显示
dim text,checkpage
text="0123456789"
Rs.PageSize=MaxPerPage
for i=1 to len(request("page"))
checkpage=instr(1,text,mid(request("page"),i,1))
if checkpage=0 then
exit for
end if
next

If checkpage<>0 then
If NOT IsEmpty(request("page")) Then
CurrentPage=Cint(request("page"))
If CurrentPage < 1 Then CurrentPage = 1
If CurrentPage > Rs.PageCount Then CurrentPage = Rs.PageCount
Else
CurrentPage= 1
End If
If not Rs.eof Then Rs.AbsolutePage = CurrentPage end if
Else
CurrentPage=1
End if

call list

'显示帖子的子程序
Sub list()%>
<table width="100%" border="0" cellspacing="1" cellpadding="4">
<tr bgcolor="#A6EDFF" class="tr_southidc">
<td width="18%" height="25">
<div align="center">汇款人</div></td>
<td width="20%">
<div align="center">联系电话</div></td>
<td width="22%">
<div align="center">汇款日期</div></td>
<td width="15%">
<div align="center">处理情况</div></td>
<td width="15%">
<div align="center">订单详情</div></td>
<td width="10%">
<div align="center">操作</div></td>
</tr>
<%
if not rs.eof then
i=0
do while not rs.eof
%>
<tr bgcolor="#ECF5FF">
<td>
<div align="center"><%=rs("hname")%></div></td>
<td>
<div align="center"><%=rs("tel")%></div></td>
<td>
<div align="center"><%=rs("date1")%></div></td>
<td>
<div align="center">
<%If rs("Flag")=0 Then%>
尚未处理
<%else%>
<b><font color="#FF0000">已经处理</font></b>
<%End If%>
</div></td>
<td>
<div align="center">
<%response.write "<a href='bank_detail.asp?ID="&rs("id1")&"&page="&CurrentPage&"' >详细资料</a>"
%>
</div></td>
<td>
<div align="center">
<%response.write "<a href='javascript:confirmdel(" & rs("id1") & ","& CurrentPage&")'>删除</a>"
%>
</div></td>
</tr>
<%
i=i+1
if i >= MaxPerpage then exit do
rs.movenext
loop
end if
%>
<tr bgcolor="#A6EDFF">
<td height="25" colspan="6">&nbsp;&nbsp;
<%
Response.write "<strong><font color='#000000'>-> 全部-</font>"
Response.write "共</font>" & "<font color=#FF0000>" & Cstr(Rs.RecordCount) & "</font>" & "<font

color='#000000'>条</font></strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
Response.write "<strong><font color='#000000'>第</font>" & "<font color=#FF0000>" & Cstr(CurrentPage)

& "</font>" & "<font color='#000000'>/" & Cstr(rs.pagecount) & "</font></strong>&nbsp;"
If currentpage > 1 Then
response.write "<strong><a href='bank.asp?&page="+cstr(1)+"'><font color='#000000'>首页

</font></a><font color='#ffffff'> </font></strong>"
Response.write "<strong><a href='bank.asp?page="+Cstr(currentpage-1)+"'><font color='#000000'>上一页

</font></a><font color='#ffffff'> </font></strong>"
Else
Response.write "<strong><font color='#000000'>上一页 </font></strong>"
End if
If currentpage < Rs.PageCount Then
Response.write "<strong><a href='bank.asp?page="+Cstr(currentPage+1)+"'><font color='#000000'>下一页

</font></a><font color='#ffffff'> </font>"
Response.write "<a href='bank.asp?page="+Cstr(Rs.PageCount)+"'><font color='#000000'>尾页

</font></a></strong>&nbsp;&nbsp;"
Else
Response.write ""
Response.write "<strong><font color='#000000'>下一页</font></strong>&nbsp;&nbsp;"
End if
'response.write "</td><td align='right'>"
'response.write "<font color='#000000' >转到:</font><input type='text' name='page' size=4 maxlength=4

class=smallInput value="&Currentpage&">&nbsp;"
'response.write "<input class=buttonface type='submit' value='Go' name='cndok'>&nbsp;&nbsp;"
%>
</td>
</tr>
</table>
<%
End sub
rs.close
conn.close
%> </td>
</tr>
</table></td>
</tr>
</table>

******************************************************************************************************

*******


<div align="center"><%=rs("hname")%></div></td>
<td>
<div align="center"><%=rs("tel")%></div></td>
<td>
<div align="center"><%=rs("date1")%></div></td>


代码里面的这几个字段名字改了下 对应数据库里面的字段也改名字了 前台可以提交写入到数据库里 后台的这个页

面读不出来是为什么呢

最佳答案
  • 五星知识达人网友:等灯
  • 2021-05-05 23:22

你先测试我给的看结果如何再做判断

全部回答
  • 1楼网友:猎心人
  • 2021-05-06 00:20

本身分页可能有问题

你用以下代码测试一下能不能读出来

<%set rs=server.CreateObject("adodb.recordset") sqltext="select hname,tel,date1 from service order by id1 desc" rs.open sqltext,conn,1,1

while not rs.eof%>

<div align="center"><%=rs("hname")%></div> <div align="center"><%=rs("tel")%></div> <div align="center"><%=rs("date1")%></div>

<%rs.movenext wend

rs.close set rs=nothing conn.close set conn=nothing

%>

我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯