<%
dim conn, connstr
on error resume next
connstr="dirver=Microsoft Access Driver (*.mdb);DBQ=" & server.mappath("data/data.mdb")
set conn=Server.CreateObject("ADODB.Connection")
conn.open connstr
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel=stylesheet href="inc/css.css" type="text/css">
<title>无标题文档</title>
</head>
<body>
<center>
<table width="330" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="19" width="330" valign="top" class="a1">公告:
<tr>
<td width="330" height="152" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="table-hx">
<tr>
<% call index_diary() %>
</td>
</tr>
</table></td>
</tr>
</table></center>
</body>
</html>
<%
sub index_diary()
set rs=server.createobject("adodb.Recordset")
strSQL="select top 4 content,date from diary order by date DESC"
rs.open strSQL,conn,1,1
do while not rs.eof
response.write "<td width='100%' align='center'>"
response.write "<img src='images/dot.gif' hspace=5 vspace=4>"&rs("content")&" "&rs("date") & vbcrlf
response.write "</td>"
rs.movenext
loop
if rs.bof and rs.eof then
response.write "<td width='100%'>"
response.write "<font color=#666666 >暂无任何公告!</font>"
response.write "</td>"
end if
rs.close
set rs=nothing
end sub
%>
数据库里有两条内容,但为什么调用函数却不能把它输出来呢?是我的函数哪儿写错了吗?
请高手指点下,谢了!