|
4#
楼主 |
发表于 2012-12-29 08:16:21
|
只看该作者
我调试成功的代码如下:
Dim rs As New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open "select * from 订单明细", CurrentProject.Connection, adOpenKeyset, adLockOptimistic
Dim RowData As Variant
Dim ColData As Variant
Dim RowTmp As Variant
Dim ColTmp As Variant
Dim R As Long
Dim C As Long
Dim aa As Excel.Workbook
Set MyXls = CreateObject("Excel.Application")
MyXls.Visible = True
Set aa = MyXls.Workbooks.Add
aa.Activate
aa.Sheets("sheet1").Cells(1, 1).CopyFromRecordset rs
rs.Close
Set rs = Nothing |
|