站内搜索:     
站点首页破釜学院编程开发ASP 编程ASP 技巧 → Display data From database into 2 Column
正在加载相关信息.....
Web 站内搜索
Display data From database into 2 Column
】【打印】【加入收藏】【关闭收藏到新浪ViVi】【收藏到365KEY】 浏览字号:
日期:2004-08-23 人气: 出处:
<%
Conn_String = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("link.mdb")
Set Conn=Server.CreateObject("ADODB.Connection")
Conn.Open Conn_String
sql = "select * from cat order by ID"
set rs = Conn.Execute (sql)
'Connect to database
%>



<table border="0" width="300">

<%
Do while NOT rs.EOF
ColNum = 1
 Do while ColNum < 3
%>

<!-- First column-->
<TD ALIGN=LEFT VALIGN=middle WIDTH="150"><a href="showlink.asp?CatID=<%=rs("id")%>"><%=rs("cat")%>
</a></TD>

<%
if NOT rs.EOF then
rs.MoveNext
end if
ColNum = ColNum + 1
if NOT rs.EOF then
%>

<!-- second column-->
<TD ALIGN=LEFT VALIGN=middle WIDTH="150"><a href="showlink.asp?CatID=<%=rs("id")%>"><%=rs("cat")%></a></TD>

<%
end if
ColNum = ColNum + 1
Loop
%>

</TR>



<%
if NOT rs.EOF then  
rs.MoveNext  
end if
Loop
%>

</TABLE>

<% rs.close
Conn.Close
set Conn = nothing
%>



>>>> 进入论坛交流 <<<<

相关文章:
暂时没有相关文章