Private Sub Form_Load()
Dim adoCON As New adoDB.Connection
Dim adoRS As New adoDB.Recordset
Dim adoDB As String
Dim wrkSQL As String
Dim wrkI As Integer
'# Excelファイル指定
adoDB = App.Path & "\test.xls"
'# DB接続
Set adoCON = New adoDB.Connection
With adoCON
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Properties("Extended Properties") = "Excel 8.0"
.Open adoDB
End With
'# Sheet1をテーブルとして使う
wrkSQL = "SELECT * FROM [Sheet1$];"
'# RecordSet Open
adoRS.Open wrkSQL, adoCON, adOpenDynamic