I can connect to an Access database successfully and using this snippet of code I can produce a horizontal list of field names.
Code: Select all
Select *
From tblMyTable
Where 1 =0
John
Code: Select all
Select *
From tblMyTable
Where 1 =0
Code: Select all
For iCols = 0 to rs.Fields.Count - 1
ws.Cells(1, iCols + 1).Value = rs.Fields(iCols).Name
Next
Code: Select all
For iCols = 0 to rs.Fields.Count - 1
ws.Cells(iCols + 1, 1).Value = rs.Fields(iCols).Name
Next