这是我写的代码,用于将数据从access导出到excel,但看不到任何记录。
Sub copyFromRecordset()
Set conn = New ADODB.Connection
Set wipData = New ADODB.Recordset
conn.ConnectionString = conStr
conn.Open
With wipData
.ActiveConnection = conn
.Source = "WipBin"
.LockType = adLockReadOnly
.CursorType = adOpenForwardOnly
.Open
End With
Worksheets.Add
Range("A2").copyFromRecordset wipData
wipData.Close
conn.Close
End Sub敬请指教
发布于 2017-08-04 03:57:14
为什么不简单地使用DoCmd.TransferSpreadsheet方法
DoCmd.TransferSpreadsheet acExport, , "TABLE name", "filelocation"https://msdn.microsoft.com/en-us/vba/access-vba/articles/acspreadsheettype-enumeration-access
https://stackoverflow.com/questions/45493230
复制相似问题