软考真题
第11题
【说明】
某网站涉及了一个留言系统,能够记录留言者的姓名IP地址以及留言时间。撰写留言页面如图4-1所示,表4-1为利用Microsoft Access 创建的数据库lyb。

【问题:4.1】(共10分)
以下图4-1所示write.asp页面的部分代码,请仔细阅读该段代码,将(1)~(10)的空缺代码补齐。

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 Recordet1.EOF))
%>
<p>&nbsp;</p>
<table width=″500″border=″1″>
<tr>
<td widfth=″108″>留言;<%=(Recordset1.Fields.Item(″ID″).Value)%></td>
<td widfth=″196″>留言;<%=(Recordset1.Fields.Item(″(12)″).Value)%></td>
<td widfth=″174″>IP;<%=(Recordset1.Fields.Item(″(13)″).Value)%></td>
</tr>
<tr>
<td rowspan=″2″>留言内容</tb>
<td colspan=″2″><label for ″textdield″></label>
<textarea name="textfield" cols="45" rows="5"
id="textfield"><%=(Recordset1.Fields .Item("ly").Value)%><Itextarea></td〉
</tr>
<tr>
<td colspan="2"> 留言时间: <%=(Recordset1.Fields.Item("(14) ").Value)%></td>
</tr>
<tr>
<td>回复内容</td>
<td colspan="2"><label for="textfield2"></label> 
<textarea name="textfield2" cols="45" rows="3"
id="textfield2"><%=(Recordset1.Fields .Item
("(15) ").Value)%></textarea></td>
</tr>
</table>

备选答案
A.submit B.ipadd C.ly D.reset E.index
F.post G.now H.textarea I.Request J.hidden
【问题:4.2】(共5分)
图4-2是留言信息显示页面.系统按照B值从大到小的顺序依次显示留言信息,点击图4-1 "返回首页"将返回到此页面。以下是图4-2所示页面文件index.asp的部分代码,请仔细阅读该段代码,将(11)~(15)的空缺代码补齐。

Set MM_editCmd = Serve.CreateObject ("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.From("ly"))' adlongvarwchar
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.AditCmd,ActiveConnection.Close

<body>
<%IP=Ruquest(〝REMOTE_ADDR〞)%>
<P><strong>撰写语言
</strong></p>
</hr>
<form ACTION=″<%=MM_editAction%>″METHOD=″( 3 )″id=″form1″name=″form1″>
<table width=″500″borde=″1″align=″center″
<tr>
<td width=″94″align=″right″>您的姓名</td>
<td width=″390″align=″left″><label for =″name″></label>
<input type=″test″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 herf =″( 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 )0%>″/>
<input type=″( 9 )″name=″button″id=″button″value=″提交″/><label for=″radio″
<input type=″( 10)″name=″button2″id=″button″value=″重置″/>
</label></td>
<tr>
</table>

备选答案
A. hf
B. ipadd
C. ID
D. name
E. lytime
IP地址
正确答案:
你的答案:
请先在App中激活(应用市场搜“软考真题”)
知识点:
试卷:
2017年 上半年 下午试卷 案例

笔记

答题卡
加油
纠错
得分:0