View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 866
Default Using ADO to get the first 5 fields horizontaly

Not working for me yet , do you maybe have the full code.
Many thanks,
Dan

"Mike" wrote:

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

"Dan" wrote:

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