Private Sub Command1_Click()
Dim xlapp As Variant
Dim xlBook As Variant
Dim xlSheet As Variant
Dim sum As Long
Set xlapp = CreateObject("excel.application")
Set xlBook = xlapp.Workbooks.Open(App.Path & "\data\æ¥è¡¨.xlt") 'æå¼EXCEL模æ¿
'Set xlBook = xlapp.Workbooks.Add
Set xlSheet = xlBook.worksheets(1)
xlapp.Visible = True
Adodc1.ConnectionString = cn.ConnectionString
Adodc1.RecordSource = "select * from [Sheet1] where è¯éªå·='" & shiyanH & "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.MoveFirst
xlSheet.Cells(sum + 1, 2) = shiyanH
For sum = 0 To Adodc1.Recordset.RecordCount - 1
xlSheet.Cells(sum + 3, 1) = Adodc1.Recordset(1)
For j = 2 To 21
If Adodc1.Recordset(j) <> "" Then
If Adodc1.Recordset(j) = "********" Then
xlSheet.Cells(sum + 3, j) = (Adodc1.Recordset(j))
Else
xlSheet.Cells(sum + 3, j) = Val(Adodc1.Recordset(j))
End If
End If
Next
Adodc1.Recordset.MoveNext
Next sum
End If
End Sub
Sub Main()
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\data\tsdb.mdb;Persist Security Info=False"
frmStart.Show
End Sub
以ä¸æ¯è¯»åAccessæ°æ®è¡¨ï¼å¯¼å
¥å°Excelç代ç ã
追é®æ¨å¥½ï¼è¯·é®è¿ä¸ªä»£ç æ¯ä¸æ¯éè¦å
å¼ç¨Microsoft Excelé¨ä»¶ï¼
è¿æå°±æ¯ç¬¬12è¡çâè¯éªå·âæ¯ä¸æ¯è¦æ¹ææèªå·±æ°æ®åºçå称ï¼è¿æ第12è¡å第16è¡çshiyanHæ¯Excelésheet1çåååï¼
追ç
1.å¼ç¨è§ä¸å¾
2.éæ¹å¨33è¡ä»£ç ä¸ºä½ çæ°æ®åºã
3.12è¡ä»£ç ç¨ä½ ç表ååç´¢å¼å段ã