【发布时间】:2011-05-04 15:53:53
【问题描述】:
假设我有一些如下代码可以从另一个访问文件中提取数据:
Sub ADO_Recordset_OpenTable()
Dim rs As ADODB.Recordset
Dim cn As ADODB.Connection
Dim MyPath As String
MyPath = CurrentProject.Path
Set cn = New ADODB.Connection
cn.Provider = "Microsoft Jet 4.0 OLE DB Provider"
cn.ConnectionString = "Data Source=C:\Users\Justin\Desktop\ExampleFile.mdb"
cn.Open
Set rs = New ADODB.Recordset
rs.Open "Schedule", cn, adOpenDynamic, adLockReadOnly, adCmdTable
' I would like to at this point build a table within the currentdb file
' with the data in the recordset. Either some kind of create table or
' SQL INSERT?? Just trying to learn how to work with the data set
所以在示例中是我的 cmets。基本上想知道如何从记录集中包含的数据中创建一个表。我想创建一个tabledef?但这是 DAO 对吧?而且我真的不能在例行程序中同时使用 DAO 和 ADO 对吗?
谢谢 贾斯汀
【问题讨论】:
标签: ms-access vba ado dao recordset