Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default How to iterate through results of SQL Query

Hi,

Easy question here, but I'm not finding any examples..

If I've just placed a SQL query, how can I iterate through the results
using VBA?

rs.Open "SELECT * FROM generic table", _
dbMain, adOpenKeyset, adLockPessimistic

---

THanks
David

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default How to iterate through results of SQL Query

David,

try something like this:

While Not rs.EOF
'do something with the current record. i.e.
Debug.Print rs(0)
'move to the next one
rs.MoveNext
Wend


--
Hope that helps.

Vergel Adriano


"David Wessell" wrote:

Hi,

Easy question here, but I'm not finding any examples..

If I've just placed a SQL query, how can I iterate through the results
using VBA?

rs.Open "SELECT * FROM generic table", _
dbMain, adOpenKeyset, adLockPessimistic

---

THanks
David


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default How to iterate through results of SQL Query

Vergel,

Thanks a ton.. That's perfect!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to iterate through results of SQL Query

On May 1, 3:03 pm, Vergel Adriano
wrote:
David,

try something like this:

While Not rs.EOF
'do something with the current record. i.e.
Debug.Print rs(0)
'move to the next one
rs.MoveNext
Wend

--
Hope that helps.

Vergel Adriano



"David Wessell" wrote:
Hi,


Easy question here, but I'm not finding any examples..


If I've just placed a SQL query, how can I iterate through the results
using VBA?


rs.Open "SELECT * FROM generic table", _
dbMain, adOpenKeyset, adLockPessimistic


---


THanks
David- Hide quoted text -


- Show quoted text -


Hey Buddy,
THaks a lot. It helped me just now

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
MS Query Results Suzseb Excel Programming 1 July 19th 06 11:16 PM
Query Results to UserForm Noel Excel Programming 1 September 29th 04 07:09 PM
Set a PivotCache as the results of a query tod Excel Programming 2 February 16th 04 05:41 PM
MS Query Limit results Gunther[_2_] Excel Programming 2 December 16th 03 08:21 PM
Query Results Michael Burkett Excel Programming 1 November 11th 03 07:46 PM


All times are GMT +1. The time now is 12:26 AM.

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

About Us

"It's about Microsoft Excel"