ADO GetRows - Properties This the tutorial/example asp script how to use ASP and ADO GetRows - Properties
ShotDev Focus:
- ASP & ADO GetRows - Properties
Example
asp_ado_getrows.asp
<% Option Explicit %> <html> <head> <title>ShotDev.Com Tutorial</title> </head> <body> <% Dim Conn,strSQL,objRec,arrData,i Set Conn = Server.Createobject("ADODB.Connection") Conn.Open "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("db/mydatabase.mdb"),"" , "" strSQL = "SELECT * FROM customer " Set objRec = Conn.Execute(strSQL) arrData = objRec.GetRows() objRec.Close() Conn.Close() Set objRec = Nothing Set Conn = Nothing '*** arrData(Field,Rows) ***' %> <table width="600" border="1"> <tr> <th width="91"> <div align="center">CustomerID </div></th> <th width="98"> <div align="center">Name </div></th> <th width="198"> <div align="center">Email </div></th> <th width="97"> <div align="center">CountryCode </div></th> <th width="59"> <div align="center">Budget </div></th> <th width="71"> <div align="center">Used </div></th> </tr> <% For i = 0 To Ubound(arrData,2) %> <tr> <td><div align="center"><%=arrData(0,i)%></div></td> <td><%=arrData(1,i)%></td> <td><%=arrData(2,i)%></td> <td><div align="center"><%=arrData(3,i)%></div></td> <td align="right"><%=arrData(4,i)%></td> <td align="right"><%=arrData(5,i)%></td> </tr> <% Next %> </table> </body> </html>
Create a asp file and save to path root-path/myasp/
Run
http://localhost/myasp/asp_ado_getrows.asp
Screenshot