柠檬试题库
search
首页
计算机
公务员
驾照
关于
rs
下列程序的功能是返回当前窗体的记录集: Sub GetRecNum() Dim rs As Object Set rs =【】 MsgBox rs.RecordCount End Sub 为保证程序输出记录集(窗体记录源)的记录数,括号内应填入的语句是( )。
下列过程的功能是:通过对象变量返回当前窗体的Recordset属性记录集引用,消息框中输出记录集的记录(即窗体记录源)个数。 Sub GetRecNum() Dim rs As Object Set rs=Me.Recordset MsgBox 【 】 End Sub 程序括号内应填写的是( )。
采用 DAO 完成对"教学管理.mdb"文件中"学生表"的学生年龄都加 1 的操作,程序空白处应填写的语句是 Sub SetAgePlus() Dim ws As DAO.Workspace Dim db As DAO.Database Dim rs As DAO.Recordset Dim fd As DAO.Field Set db = CurrentDb() Set rs = db.OpenRecordset("学生表") Set fd = rs.Fields("年龄") Do While Not rs.EOF ___________ fd = fd + 1 rs.Update rs.MoveNext Loop rs.Close db.Close Set rs = Nothing Set db = Nothing End Sub
采用 ADO 完成对"教学管理.mdb"文件中"学生表"的学生年龄都加1的操作,程序空白处应填写的是 Sub SetAgePlus( ) Dim cn As New ADODB.Connection Dim rs As New ADODB.Recordset Dim fd As ADODB.Field Dim strConnect As String Dim strSQL As String Set cn=CurrentProject.Connection strSQL="Select 年龄 from 学生表" rs.Open strSQL, cn, adOpenDynamic, adLockOptimistic, adCmdText Set fd=rs.Fields("年龄") Do While Not rs.EOF fd=fd+1 ___________ rs.MoveNext Loop rs.Close cn.Close Set rs=Nothing Set cn=Nothing End Sub
假设数据库中有学生信息表stud(sno,sname,ssex)。其中,性别ssex字段已建索引,要在 调试窗口中显示第一个男同学的信息,程序空白处应填写的语句是 Private Sub Form_Load( ) Dim rs As ADODB.Recordset Set rs= New ADODB.Recordset rs.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source= e:\考试中心教程\教学管理.mdb;" rs.CursorType = adOpenKeyset rs.LockType = adLockOptimistic rs.Index = "ssex" rs.Open "stud" , , , , adCmdTableDirect _______________ Debug.Print rs("sno "), rs("sname "), rs("ssex ") rs.Close Set rs = Nothing End Sub
假设数据库中有学生信息表 stud(sno,sname,ssex),其中 ssex 字段已建索引,要输出最后一名男同学的信息,程序空白处应填写的语句是 Private Sub Form_Load() Dim rs As ADODB.Recordset Set rs = New ADODB.Recordset rs.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source= e:\考试中心教程\教学管理.mdb;" rs.CursorType = adOpenKeyset rs.LockType = adLockOptimistic rs.Index = "ssex" rs.Open "stud" , , , , adCmdTableDirect ________________ Debug.Print rs("sno "), rs("sname "), rs("ssex ") rs.Close Set rs = Nothing End Sub
子过程Plus完成对当前库中"教师表"的工龄字段都加1的操作。 Sub Plus( ) Dim ws As DAO.Workspace Dim db As DAO.Database Dim rs As DAO.Recordset Dim fd As DAO.Field Set db = CurrentDb() Set rs = db.OpenRecordset("教师表") Set fd = rs.Fields("工龄") Do While Not rs.EOF rs.Edit 【 】 rs.Update rs.MoveNext Loop rs.Close db.Close Set rs = Nothing Set db = Nothing End Sub 程序空白处应该填写的语句是
随机标签
result
ppt
0do
change
产生