Using ADO to get the first 5 fields horizontaly

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

Hi,
I know how to retieve data via ADO from access.
But can I
1) retrieve only the first 5 first records of the result of SQL
2) display them in Excel horizontaly (First in A1, second in B1, third in
B3...)
Many thanks,
Dan
 
Try this
If (Not rs.BOF Or rs.EOF) Then
For i = 1 To 5
Cells(1, i) = rs.Fields("FieldName").Value
rs.MoveNext
Next i
End If
 
Back
Top