代码如下
Set conn = CreatObject("ADODB.Connection")
conn.connectionstring = "rovider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\line.mdb"
conn.Open
Dim rs As New ADODB.Recordset
rs.Open "select 名称 from linespe"
Dim i As Integer
i = 1
Do While Not rs.EOF
Cells(i, 1).Value = rs("名称")
rs.movenext
i = i + 1
Loop
rs.Close
conn.Close
总在 CreatObject("ADODB.Connection")和ADODB.Recordset处提示过程或函数未定义。
有人说在使用ADO前要先引用,但我引用了如下几个还是不行
visual basic for application
microsoft excel 11.0 object library
OLE Automation
microsoft office 11.0 object library
microsoft ActiveX Data Objects 2.8 library
microsoft ActiveX Data Objects Recordset 2.8 library
microsoft ADO Ext. 2.8 for DDL and Security