[求助]将数据库数据输出到excel
我程序运行时如图
但输出到excel时有一行日期的值为#######
如图
附控件的代码:
Private Sub Command1_Click()
Dim i As Integer
Dim j As Integer
Dim xlApp As New Excel.Application
Dim xlBook As New Excel.Workbook
Dim xlSheet As New Excel.Worksheet
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
Set xlBook = xlApp.Workbooks.add
Set xlSheet = xlBook.Worksheets(1)
For j = 0 To mgrid.Columns.Count - 1
xlSheet.Cells(1, j + 1) = mgrid.Columns.Item(j).Caption
Next j
Adodc1.Recordset.MoveFirst
For i = 0 To Adodc1.Recordset.RecordCount - 1
mgrid.Row = i
For j = 0 To mgrid.Columns.Count - 1
mgrid.Col = j
If IsNull(mgrid.Text) = False Then
xlSheet.Cells(i + 2, j + 1) = mgrid.Text
End If
Next j
Next i
End Sub
这是为什么,有哪位站友能指明下原因,教我应该如何做,谢谢