Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   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

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Using ADO to get the first 5 fields horizontaly

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

  #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

  #4   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

Sorry, working now, was my Typo, many thanks.
DAN

"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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Using ADO to get the first 5 fields horizontaly

it would be better if you posted your code....

"Dan" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
fields names do not show in excel 2007 pivot table fields list marlo17 New Users to Excel 2 December 1st 08 01:25 PM
I have a bar chart and i want to horizontaly align the datalabel charles Charts and Charting in Excel 1 August 12th 06 01:26 AM
Excel SHOULD NOT AUTO-CHANGE formated text fields to DATE FIELDS! PSSSD Excel Worksheet Functions 2 August 8th 06 09:31 PM
Scroll horizontaly with mouse, create same system used to scroll . frederic New Users to Excel 5 October 9th 05 08:15 PM
Catalogue of fields' connection whit external fields ( sheets) Nicola Bianchi Excel Programming 0 September 27th 03 10:42 AM


All times are GMT +1. The time now is 05:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"