首页 > Web开发 > 详细

[实战]ASP show account list

时间:2015-04-21 14:47:17      阅读:450      评论:0      收藏:0      [点我收藏+]

<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的心路旅程” 博客,谢绝转载!

[实战]ASP show account list

原文:http://ericfu.blog.51cto.com/416760/1636480

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!