利用ASP打造网站论坛DIY(3)
2006-04-08 11:59:40 来源:WEB开发网Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft AccessDriver (*.mdb)};dbq=" & Server.MapPath("bbssystem.mdb")
Set cmd = Server.CreateObject("ADODB.Command")
Set cmd.ActiveConnection = conn
sql="select 名称 from 看板列表 whereid=" & boardid
set rs=conn.execute(sql)
boardname=rs("名称")
cmd.commandtext="未发表文章列表"
ReDim param(0)
param(0) = CLng(boardid)//注:Clng 不可忽略
Set rs = cmd.Execute( ,param )
set cmd=nothing
%>
< html>
< head>
< title>版务处理< /title>
< meta http-equiv="Content-Type"content="text/html; charset=GB2312">
< /head>
< body bgcolor="#FFFFFF">
< h1 align="center"><%=boardname%>版务管理< /h1>
< hr>
< %
if rs.eof or rs.bof then response.write "<H2>现在没有文章要处理< /h2>"
response.end
%>
注:如果没有新文章被网友发布,这给出相应的提示,并用response.end来结束此页的显示。< table width="90%" border="0"cellspacing="0" cellpadding="0"align="center" >
< tr bgcolor="#FFFFCC">
< td width="40%" height="20">主题</td>
< td width="40%" height="20">文章标题</td>
< td width="8%" height="20">作者</td>
< td width="12%" height="20">日期</td>
< /tr>
< %
do
topicid=rs("主题id")
articleid=rs("文章id")
data=rs("日期")
datastr=cstr(year(data)) & "-"& cstr(month(data)) &"-"& cstr(day(data))
author=rs("作者")
articlename=rs("标题")
topicname=rs("主题")
response.write "< tr>< td><a href=qtopic.asp?topicid="& topicid& ">" & topicname &"< /A>< /td>"
response.write "< td>< a href=managearticle.asp?articleid="&articleid & "&boardid="& boardid &">" &articlename & "< /A>< /td>"
response.write "< td>< a href=qauthor.asp?author="&author & ">" & author& "< /a>< /td>"
response.write "< td>" &datastr & "< /td>< /tr>"
rs.movenext
loop until rs.eof
%>
< /table>
< /html>
< %
set rs=nothing
conn.close
set conn=nothing
%>
< /body>
更多精彩
赞助商链接