Display data From database into 2 Column
2000-11-11 10:13:27 来源:WEB开发网核心提示:<%Conn_String = "DRIVER={Microsoft access Driver (*.mdb)};DBQ=" & Server.MapPath("link.mdb") Set Conn=Server.CreateObject("ADODB.
<%
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
%>
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
%>
- ››DataGrid中CheckBox绑定bool属性来进行选中判断
- ››data/data/目录下的私有数据
- ››Data Web Services:访问IBM数据库服务器的新方式...
- ››datagridview checkbox控件
- ››DataGridView表尾统计控件3
- ››DataReader与DataSet的区别
- ››data/tmp等文件夹777检测属性不通过的解决方法
- ››DataSet导出到Excel比较完整的解决方案(一)--客...
- ››DataSet导出到Excel比较完整的解决方案(二)--服...
- ››DataSet导出到Excel比较完整的解决方案(二)--服...
- ››DataCore发布中小企业SAN软件解决方案
- ››Data Studio Administrator V1.2 中的数据保留和数...
更多精彩
赞助商链接