Click to See Complete Forum and Search --> : stuck on loop issue


chrismartz
02-03-2006, 02:17 PM
I have the attached page that I need to loop all the information on it for each parent in the database. I tried doing a while loop for the rs around the whole table but it gave me an error. Any help would be appreciated.

lmf232s
02-04-2006, 08:42 AM
what is the error?

chrismartz
02-04-2006, 09:36 AM
I don't have an error with that file I attached. When I put a While loop around the whole table with information using While Not SQL.EOF I get an error that says SQL is not a object.

lmf232s
02-05-2006, 08:57 AM
chrismartz,
Im just looking at the text file and dont have the ability to open it in any kind of an editor right now but i did notice 1 thing.

Whth in the page you supplied you have 2 sections that loop the record set.
You start by writing the header and what not but then you loop the first section w/ Name, School, Grade, and gender and then you loop those untill RS is EOF.

You also have a section below that you loop w/ donation even, and amounts where you again loop the RS untill its .EOF.

So in looking at it if you wrap a loop around the whole thing, when it hits the line RS.Movenext on the big loop around the whold thing, it should error out as there is no where to move since you are already at the end of the file.

It almost looks like you need to execute 3 sql statements.

1 to get the header information
1 to get the 1st details section
1 to get the 2nd detials section.

Then you need 2 RS
RS1
RS2

For the header you would loop the 1st record set and then execute the other statements w/ the second recordset. Example

SQL = SQL + "EXEC s_MassContact_GetDonationInfo "
RS1.Open SQL, Conn
Do While Not RS1.EOF

SQL = "sp_DetailSection1"
RS2.Open SQL, Conn
Do While Not RS2.EOF

RS2.MoveNext
Loop


SQL = "sp_DetailSection2"
RS2.Open SQL, Conn
Do While Not RS2.EOF

RS2.MoveNext
Loop


RS1.MoveNext
Loop

chrismartz
02-06-2006, 10:08 AM
I have attached my file that I modified but I keep getting Error of:Microsoft VBScript runtime error '800a01a8'

Object required

/foundation/massfdetailsprint.asp, line 116 Any help would be appreciated.

lmf232s
02-06-2006, 12:30 PM
Not sure but it looks like your Stored Procedure was called
s_GetStudentsLink
and on line 116 you are now trying to call
s_GetStudents

Did you rename your SP?

chrismartz
02-06-2006, 02:17 PM
Got it figured out!