题目内容:
“学生成绩”表含有字段学号,姓名,数学,外语,专业,总分.。下列程序的功能是:计算每名学生的总分总分=数学+外语+专业.。请在程序空白处填入适当语句,使程序实现所需要的功能。Private Sub Command1_Click( )
Dim cnAs New ADODB.Connection
Dim rsAs New ADODB.Recordset
Dim zongfenAs New ADODB.Fileld
Dim shuxueAs New ADODB. Fileld
Dim waiyuAs New ADODB. Fileld
Dim zhuanyeAs New ADODB. Fileld
Dim strSQLAsSting
Set cn = CurrentProject.Connection
StrSQL = “Select*from成绩表”
rs.OpenstrSQL, cn, adOpenDynamic, adLockptimistic, adCmdText
Set zongfen = rs.Filelds(“总分”)
Set shuxue = rs.Filelds(“数学”)
Set waiyu = rs.Filelds(“外语”)
Set zhuanye = rs.Filelds(“专业”)
Do while【14】
Zongfen = shuxue + waiyu + zhuanye
【15】
rs.MoveNext
Loop
rs.close
cn.close
Set rs = Nothing
Set cn = Nothing
End Sub
参考答案:
答案解析: