Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem iterating a recordset (I think) ????

Status
Not open for further replies.

link9

Programmer
Nov 28, 2000
3,387
US
Here is a small control statement that is not wanting to execute. It's timing out, and I can't figure out why.

while not sessionRS.eof
thisValue = sessionRS("Q1")
if thisValue >= 1 and thisValue <= 10 then
top3Total = top3Total + 1
end if
if thisValue >= 8 and thisValue <= 10 then
top3Valid = top3Valid + 1
end if
sessionRS.movenext
wend

sessionRS is the recordset created from the database. It may be helpful to know that the recordset is created from several tables (2000Data, demographics, opcsales, and others). If I comment the entire block out, the script executes fine, but when I try to let the block execute, the script hangs up here and times out.

If anyone can see what's wrong, I would appreciate you pointing it out for me.

Thanks,
Paul Prewett
 
select statement for sessionRS:

&quot;select * from demographics, Food2000Data, opcsales where (demographics.SVP = 51) and (demographics.VPO = 51)&quot;

&quot;Q1&quot; is a field in the 2000FoodData, and I have tried the syntax, 'sessionRS(&quot;Food2000Data.Q1&quot;)', but it returns an error, so I changed it back.

If you need any other info, please let me know.

Is there some setting that I need to put on that recordset to allow for this iterating? If so, what should it (they) be?

Thanks
Paul Prewett
 
the code:
dim con, sessionRS

set con = server.CreateObject (&quot;ADODB.Connection&quot;)
con.Open &quot;DBQ=&quot; & Server.Mappath(&quot;heClientRG.mdb&quot;) & &quot;;Driver={Microsoft Access Driver (*.mdb)};&quot;
set sessionRS = server.CreateObject (&quot;ADODB.Recordset&quot;)
sessionRS.ActiveConnection = con
sessionRS.Open sqlStatement

Obviously, the 'sqlStatement' contains the string in my previous post.

The recordset may be approximately 300 rows X 40 columns. Each field is fairly small data, maybe 20 characters at the most.
Most are simple 1-10 numbers.

That's pretty much it. The recordset is then passed by reference around to several class functions and other various subroutines, but never modified after the original creation.

Paul Prewett
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top