|
|
|
asp แสดงข้อมูลจาก access แบ่งคอลัมบ์ column ซ้ายไปขวา บนลงล่าง |
|
|
|
|
|
|
|
Code (ASP)
<% Option Explicit %>
<html>
<head>
<title>ThaiCreate.Com Tutorial</title>
</head>
<body>
<%
Dim Conn,strSQL,objRec,intRows
Set Conn = Server.Createobject("ADODB.Connection")
Conn.Open "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("db/mydatabase.mdb"),"" , ""
strSQL = "SELECT * FROM gallery "
Set objRec = Server.CreateObject("ADODB.Recordset")
objRec.Open strSQL, Conn, 1,3
Response.Write("<table border='0' cellspacing='1' cellpadding='1'><tr>")
intRows = 0
While Not objRec.EOF
intRows = intRows + 1
Response.Write("<td>")
%>
<center>
<img src="thaicreate/<%=objRec.Fields("Picture").Value%>"><br>
<%=objRec.Fields("GalleryName").Value%>
<br>
</center>
<%
Response.Write("</td>")
If intRows Mod 2 = 0 Then
Response.Write("</tr>")
End If
objRec.MoveNext
Wend
Response.Write("</tr></table>")
objRec.Close()
Conn.Close()
Set objRec = Nothing
Set Conn = Nothing
%>
</body>
</html>
Go to : ASP Microsoft Access Multiple Column
|
|
|
|
|
Date :
2011-05-28 07:55:28 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|