题目:阅读下列说明,回答问题1至问题2,将解答填入答题纸的对应栏内。
【说明】
某网站设计了一个留言系统,能够记录留言者的姓名、IP地址以及留言时间。撰写留言页面如图4-1所示,表4-1为利用Microsoft Access 创建的数据库lyb。
【问题1】(10分)
以下是图4-1所示write.asp页面的部分代码,请仔细阅读该段代码,将(1)~(10)的空缺代码补齐。
Set MM_editCmd = ServerObject)("ADODB.Command")
MM_editCmd.ActiveConnection = MM_Connbook_STRING
MM_editCmd.CommandText = "INSERT INTO lyb (name,(1),ipadd,lytime)VALUES(?,?,?,?)"
MM_editCmd.Prepared = true
MM_editCmd.Parameters.AppendMM_editCmd.CreateParameter("param1", 202, 1, 255, Request.Form("name"))'adVarWChar
MM_editCmd.Parameters.AppendMM_editCmd.CreateParameter("param2", 203, 1, 536870910, Request.Form("ly"))'adVarWChar
MM_editCmd.Parameters.AppendMM_editCmd.CreateParameter("param3",202,1,255,(2).Form("ipadd"))'adVarWChar
MM_editCmd.Parameters.AppendMM_editCmd.CreateParameter("param4", 135, 1, -1, MM_IIF(Request.Form("lytime"),Request.Form("lytime").null))'adDBTimeStamp
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
<body>
<%IP-Reuest("REMOTE_ADDR")%>
<p><strong>撰写留言
</strong></p>
<hr/>
<form ACTION="<%=MM_editAction%>"METHOD="(3)"id="form1" name="form1">
<table width="500"border="1"align="center">
<tr>
<td width="94" align="right">您的姓名</td>
<td width="390" align="left"><label for="name"></label>
<input type="text" name="name" id="name"/></td>
</tr>
<tr>
<td align="right">您的留言</td>
<td align="left"><label for="ly"></label>
<(4) name="ly" cols="50" rows="5" id="ly"> </textarea> </td>
</tr>
<tr>
<td align="center"><a href="(5).asp">返回首页</a></td>
<td align="center"><input name="(6)"type="hidden"id="ipadd"value="<%=ip%>"/>
<input name="lytime" type="(7)" id="lytime"value="<%=(8)()%>"/>
<input type="(9)"name="button" id="button" value="提交"/><label for="radio">
<input type="(10)"name="button2" id="button2" value="重置"/>
</label></td>
</tr>
</table>
(1)~(10)备选答案
A.submit B.ipadd C.ly D.reset E.index F.post G.now H.textara I.Request J.hidden
【问题2】(共5分)
图 4-2 是留言信息显示页面,系统按照ID 值从大到小的顺序依次显示留言信息,点击图 4-1 "返回首页"将返回到此页面。以下是图 4-2 所示页面文件 index.asp 的部分代码,请仔细阅读该段代码,将(11)~(15)的空缺代码补齐。
Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
Recordset1 cmd.ActiveConnection = MM Connbook STRING
Recordset1_cmd.CommandText = "SELECT * FROM lyb ORDER BY(11) DESC"
Recordset1_cmd.Prepared =true
<body>
<%
While ((Repeat1_numRows<>0)AND(NOT Recordset1.EOF))
%>
<P>&nbs;</p>
<tr>
<td width=""108">留言:<%=(Recordset1.Fields.Item("ID").Value)%></td>
<td width=""196">姓名:<%=(Recordset1.Fields.Item("(12)").Value)%></td>
<td width=""174">IP:<%=(Recordset1.Fields.Item("(13)").Value)%></td>
</tr>
<tr>
<td rowspan="2">留言内容</td>
<td colspan="2"><label for="textfield"></label>
<textarca name="textfield" cols="45" rows="5" id="texefield"><%=(Recordset1.Fields.Item("ly").Value)%></textarea></td>
</tr>
<tr>
<td colspan="2">留言时间:<%=(Recordset1.Fields.Item("(14)").Value)%></td>
</tr>
<tr>
<td>回复内容</td>
<tr>
<td>回复内容</td>
<td colspan="2"><label for="textfield2"></label>
<textarca name="textfield2" cols="45" rows="3" id="texefield2"><%=(Recordset1.Fields.Item("(15)").Value)%></textarea></td>
</tr>
</table>
(11)~(15)备选答案:
A.hf B.ipadd C.ID D.name E.lytime