ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Looping Through A Recordset (https://www.excelbanter.com/excel-programming/274811-re-looping-through-recordset.html)

Tim Williams

Looping Through A Recordset
 
What database? This is incredibly slow for 55k records (I'm assuming that
the number of records returned by the query is relatively small).

Does the query take a similar amount of time if you execute it in a
different query tool?

tim


"ibeetb" wrote in message
...
I am looping through a recordset but it is taking FOREVER. It is a DB

field
that I am trying to collect a Disitinct list from. Here is the code: By

the
way, this code is tunning in Excel using ADO...
By the way, there are a total 0f 55000 records to loop through. Anyway I

can
make this faster. It takes 5-6 minutes to create a distinct recordset


'Fills the Teams list box with available team names
src = "SELECT DISTINCT
public.tts_time_weekly_report_display.team_name "
src = src & "FROM public.tts_time_weekly_report_display "
src = src & "WHERE
public.tts_time_weekly_report_display.tts_time_wee k_worked '12/31/2002'

"
rs.Open Source:=src, ActiveConnection:=cnn

Do While Not rs.EOF
frmTeams.lstTeam.RowSource = rs
frmTeams.lstTeam.AddItem rs.Fields("team_name").Value
rs.MoveNext
Loop








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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com