题目
在VB中连接并读取Access数据库文件通常使用以下代码:Dim conn As New ADODB ConnectionDim rs As New ADODB. RecordsetDim n as IntegerPrivate Sub Form_Load ( )conn. ConnectionString ="Provider= Microsoft. Ace. OLEDB. 12.0;data source =" + App. Path + " \data \data. accdb" ‘ 此处内容在同一行中,因印刷排版限制而换行conn. OpensqI = “select * from student”Set rs. ActiveConnection = connrs. Open sqln=0Do while Not rs. EOF Call read ( ) n=n+1 rs. MoveNextLoopEnd subsub read ( ) List1.AddItem rs ("name")End sub运行上述程序,以下说法不正确的是( )
A . 当前读取的数据库文件为data目录下的data.acdb
B . 数据库中存在一个名为student的数据表
C . List1列表框中将显示所有name字段的值
D . 当前读取的数据表中总记录数为n-1
答案:D