CSDN博客

img onlytiancai

蛙蛙推荐:asp中getrows的用法

发表于2004/7/7 8:38:00  878人阅读

<!-- 蛙蛙推荐:asp中getrows的用法 -->
<%
Dim conn,strconn
Set conn = Server.CreateObject("ADODB.Connection")
strconn="Driver={sql server};server=192.168.0.110;database=new;uid=sa;pwd=sa;"
conn.Open strconn
dim rs_wawa,sql_wawa,arr_wawa
set rs_wawa = Server.CreateObject("ADODB.Recordset")
sql_wawa="select top 5 id,title from wen where lei=161 order by id desc"
rs_wawa.open sql_wawa,conn,1,1
arr_wawa=rs_wawa.getrows()
rs_wawa.close()
set rs_wawa=nothing
%>
<table width="100%" border="0" cellspacing="1">
<% If ubound(arr_wawa)<>0 Then %>
<% for i=0 to ubound(arr_wawa,2)-1 %>
<tr>
<td><a href="view.asp?id=<%= arr_wawa(0,i) %>"><%= arr_wawa(1,i) %></a></td>
</tr>
<% next %>
<% Else %>
<tr>
<td>还没有新闻呢</td>
</tr>
<% End If %>
</table>
0 0

相关博文

我的热门文章

img
取 消
img