[实战]ASP show account list

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>PO2 Account List</title>
</head>

<body>

<h2 align = center >PO2 Account List</h2>

<hr>

<%

dbpath=server.mappath("Account.accdb")

‘response.write dbpath

 set connread=server.createobject("adodb.connection")
 connread.open "provider=Microsoft.ACE.OLEDB.12.0;data source="&dbpath
 exec="select*from AccountList"
 
set rsread=server.createobject("adodb.recordset")

rsread.open exec,connread,1,1
 
if connread.Errors.Count > 0 then
 
    for i = 1 to connread.Errors.Count
 
 set err=connread.Errors.Item(i-1)
 
 response.write err.Number & err.Description

 Next
 
end if  
%>

<table width="100%" bgcolor="#fff5ee">
       <tr>
       <%for each x in rsread.Fields
       response.write("<th align=‘middle‘ bgcolor=‘#b0c4de‘>" & x.name & "</th>")
       next
    %>
       </tr>
         <%do until rsread.EOF%>
          <tr>
         <%for each x in rsread.Fields %>
         <td align = ‘middle‘><%Response.Write(x.value)%></td>
         <%next
          rsread.MoveNext
   %>
          </tr>
 
        <%loop
        rsread.close
        connread.close
  
  set connread =nothing
  set rsread = nothing
  
        %>


</table>

<hr>
<em>Version: 1.1 </em>

</body>

</html>


本文出自 “Eric的心路旅程” 博客,谢绝转载!

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。