码迷,mamicode.com
首页 > Web开发 > 详细

[实战]ASP show account list

时间:2015-04-21 14:49:43      阅读:122      评论:0      收藏:0      [点我收藏+]

标签:asp

<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

标签:asp

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!