问答题
【说明】 某大学利用VOD视频服务系统提供教学课件在线点播服务。该视频服务系统用ASP语言编程实现,主页文件名为“index.asp”,部分网页运行的效果如图2-13所示。程序中使用的Access数据表结构见表2-8和表2-9。 【conn.asp文档的内容】 <% dim db,conn,connstr db="vod.mdb" set Conn=server.CreateObject ("ADODB.connection") connstr="proyider=microsoft.jet.oledb.4.0;data source=" &server.MapPath ("data/"&db&"") %> 【index.asp 文档的内容】 (2) <!--第(2)处 --> <html> <head> <title>视频服务系统</title> <style type="text/css"> <! td font-size:12px;line-height:17px body font-size:12px;line-height:17px p margin-top:1px;margin-bottom:1px a:link text-decoration:none;color:black a:visited text-decoration:none;color:black --> </style> </head> <body leftmargin="0" topmargin="0"> <!--#5nclude file="head.asp" --> <table> <td height="30" width="367"> <%sq1="select * from item" setrs_item=server, createobjiect ("adodb.recordset") rs_iterm.open sq1,connstr, 1,1 response.write"<p><b><img src=images/dot1.gif><a href=index.asp>全部节目</a> " do while not rs_item.eof response.write "<imgstc--images/dot1.gif botder=-0><a href=index.aspitem="&rs_item ("name") &">"&rs_item ("name") A"</a> " (5) <!-- 第(5)处 --> response.write "</b> " rs hm.close%> </td> </table> </div> <div align="center"> <% dim item_type item_type= (7) <!-- 第(7)处 --> if item_type="" or itcrn_type ="全部节目" then sq1="sclect * from data" else sq1=" (8) <!-- 第(8)处 --> end if set rs=server, createobject ("adodb.recordset") rs.open sql,connslr,1,1 %> <table <tr> <td width="125" background="images/bg.gif’ height="30"> <img border="0" src="images/biao_left.gif" width="15" height="15">节目名称</td> <td width="58" background="images/bg.gif" height="30" align="center">格式类型</td> <td width="43" background-"images/bg, gift height="30" align="center">点播次数</td> <td width="70" background="images/bg.gif" height="30" align="center">创建日期</td> <td width="ll5" background="images/bg.gif" height="30" align="center">点播</td> <td width="73" background="images/bg, gif" height="30’" align="center">下载</td> </tr> <%do while not rs.eof%> <tr> <rd width=" 125" height" 30" > <img bgrder=-"0" src="images/dian.gif"> <%=rs("name") %></td> <td width="115" height="30" align="center"><a href=""> 点播</td> <td width="58" height="30" align="center"><%=rs ("type") %></td> (9) <!-- 第(9) --> <td width="70" height="30" align="center"><%=rs ("date") %></rd> </tr> loop%> </table> </div> <!-- 此处省略了部分代码--> <!-- #include file="foot.asp" --> </body> </html> 【问题2】 请根据图2-13网页的显示效果,将ASP程序中(2)、(5)、(7)、(8)、(9)空缺处的代码补充完整。 A.Trim (request("item")) B.rs_item.movenext C. rs.movenext D. <!--#include file="conn.asp" --> E. select * from data where item="&item_type&" F. <td width="43"height="30"align="center"><%=rs ("Brand") %></td> G. <td width="43"height="30"align="center"><%=rs ("hits") %></td>
【参考答案】
(2)D,或<!-- #include file="conn.asp"--> (5)B,或rs_item.move......(↓↓↓ 点击下方‘点击查看答案’看完整答案、解析 ↓↓↓)
点击查看答案&解析