怎样将access查询的数据导出excel (包括字段名一起导出)
Dim i As Integer, j As IntegerDim myexcel As New Excel.Application '定义一个新的Excel对象
Dim mybook As New Excel.Workbook '定义一个新的BOOK对象
Dim mysheet As New Excel.Worksheet '定义一个新的SHEET对象
Set mybook = myexcel.Workbooks.Add '添加一个新的BOOK
Set mysheet = mybook.Worksheets.Add '添加一个新的SHEET
Set mysheet = mybook.Worksheets(1) '设置活动工作表
For i = 1 To Adodc1.Recordset.RecordCount
For j = 1 To Adodc1.Recordset.Fields.Count
mysheet.Cells(i , j) = Adodc1.Recordset.Fields.Item(j - 1).Value
Next j
Adodc1.Recordset.MoveNext
Next i
myexcel.Visible = True
这段代码只能导出查询的数据不能导出字段名,请问如何修改才能 一起导出字段名 --------------------编程问答-------------------- http://download.csdn.net/detail/veron_04/1483928
补充:VB , 数据库(包含打印,安装,报表)