|
|
|
ช่วยดูโค้ดให้หน่อยคัฟ การเขียนภาษา asp เปลี่ยนจากภาษา php |
|
|
|
|
|
|
|
ใช้คำสั่ง GetRows ได้ครับ
Code (ASP)
<%
Dim Conn,strSQL,objRec,arrData,i
Set Conn = Server.Createobject("ADODB.Connection")
Conn.Open "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("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>
|
|
|
|
|
Date :
2015-05-01 08:57:19 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|