<table border="1" width="100%">
<tr>
<%
Set rs=nothing
Set conn = Server.CreateObject("ADODB.connection")
DBPath = Server.MapPath("database/tree.mdb")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath

Set rs = Server.CreateObject("ADODB.RecordSet")
Sql = "Select * From picture_data"
rs.Open Sql, conn, 1,1

i=1
Do While not rs.Eof
if i mod 3=1 and i<>1 then response.write("</tr><tr>") '控制每幾張換行
%>
<td><img border="0" src="data/<%=trim(rs("picture_path"))%>" width="300" height="250" align="right"></td> '圖片要記得加trim把前後空白去除
<%
rs.MoveNext
i=i+1
Loop
conn.Close
Set rs=nothing
Set conn=nothing
%>
</tr>  
</table>

arrow
arrow
    全站熱搜

    lovean 發表在 痞客邦 留言(0) 人氣()