Oh well.
Can you just test this version
Public Sub GetAccessDataADO()
Dim stConn As String
Dim rst As Object
Dim x As Long
Dim y As Long
Dim vaData
x = 3
stConn = "Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\Test\Test.mdb;"
Set rst = CreateObject("ADODB.Recordset")
rst.Open "Select * from qry_check_time", stConn, 3
If Not rst.EOF Then
vaData = TransposeGetRows(.GetRows())
rst.Close
For x = LBound(vaData, 1) To UBound(vaData, 1)
For y = LBound(vaData, 2) To UBound(vaData, 2)
Sheets(2).Cells(2 + x, y).Value = vaData(x, y)
Next y
Next x
Else
rst.Close
End If
End Sub
Function TransposeGetRows(varData) As Variant
Dim lngRow As Long, lngCol As Long
Dim varOut()
ReDim varOut(1 To UBound(varData, 2) + 1, 1 To UBound(varData, 1) + 1)
For lngRow = LBound(varData, 2) To UBound(varData, 2)
For lngCol = LBound(varData, 1) To UBound(varData, 1)
varOut(lngRow + 1, lngCol + 1) = varData(lngCol, lngRow)
Next lngCol
Next lngRow
TransposeGetRows = varOut
End Function
Bookmarks