Sub b2_udl_accdb抽出PL()
Sheets("test").Select
Range("b1:i200").ClearContents
Dim i As Long
Dim mySQL As String
Call a05_InODBC
For ii = 1 To 2
Select Case ii
Case 1
mySQL = "select * from PL"
Set rs = cn.Execute(mySQL)
With rs
'フィールド名
For i = 1 To .Fields.Count
Cells(1, i + 1).Value = .Fields(i - 1).Name
'行1,列2に抽出
Next
'レコード
Range("b2").CopyFromRecordset rs
End With
'myCon.Close
End Select
Next
Call a09_OutODBC
End Sub