Display data From database into 2 Column

2016-01-29 18:11 15 1 收藏

Display data From database into 2 Column,Display data From database into 2 Column

【 tulaoshi.com - ASP 】

  <%
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
%


 

来源:http://www.tulaoshi.com/n/20160129/1504705.html

延伸阅读
标签: 电脑入门
Time has faded from the memory. Love remained short,but the memory lasts long@ All or nothing now or never. 要么没有,要么全部.要么现在,要么永不. I will let you know You liked my 「我会让你知道你是喜欢我的」 I prefer forever to everday . Distance makes the hearts grow fonder. Just like the sunflower proud alive ....
标签: Web开发
Sample script that deletes a SQL Server database. Supported Platforms SQL Server 2000  Yes Script Code 代码如下: strDBServerName = "."  strDBToDelete       = "ScriptingGuysTestDB"  Set&...
标签: Web开发
display:block就是将元素显示为块级元素. block元素的特点是: 总是在新行上开始; 高度,行高以及顶和底边距都可控制; 宽度缺省是它的容器的100%,除非设定一个宽度 div, p, h1, form, ul 和 li是块元素的例子。 display:inline就是将元素显示为行内元素. inline元素的特点是: 和其他元素都在一行上; 高,行高及顶和底边距不...
标签: Web开发
Display SQL Server Login Mode. Supported Platforms SQL Server 2000  Yes Script Code SQLDMOSecurity_Integrated  = 1  SQLDMOSecurity_Mixed         = 2  SQLDMOSecurity_Normal   ...
In my recent blog, AxShDocVw, SHDocVw, mshtml References, I showed how to set up a VS.NET project to use the AxSHDocVw.AxWebBrowser control. I was recently asked how to display formatted XML in this control. Here's just one way. I'm sure you can find ways to improve upon it.private void DisplayXml ( AxSHDocVw.AxWebBro...

经验教程

374

收藏

78
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部