Paks
Paks

Reputation: 1470

Do Until Recordset.Eof is not working as expected (ASP Classic)

I have an Active Server Page, which displays Booking of the current Day.

With that Code i get the Informations from the DataBase:

Do Until Recordset.Eof



      rsRaum.open "select raum_id, KOPPELBESTUHLUNG_ID from RESERVIERUNGRAUM where buchung_id = " & Recordset("buchung_id"), Connection
            raum_id = rsRaum("raum_id")
            KOPPELBESTUHLUNG_ID = rsRaum("KOPPELBESTUHLUNG_ID")
      rsRaum.close


      rsRaum.open  "SELECT NAME, FIRMA FROM TEILNEHMER WHERE BUCHUNG_ID =" & Recordset("buchung_id") & "and STATUS = 2 and DAILYPLAN = 1" , Connection
             if not rsRaum.EOF then
                    TeilnehmerNameExtern = rsRaum("NAME")
                    TeilnehmerFirmaExtern = rsRaum("FIRMA")
             end if
      rsRaum.close




      ' hole Raum Details
      rsRaum.open "select bezeichnung from Raum where ID = " & raum_id, Connection

          raumname = rsRaum("bezeichnung")

      rsRaum.close



    Recordset.MoveNext
    Loop

So Far it works fine. My Only Problem is that part:

rsRaum.open  "SELECT NAME, FIRMA FROM TEILNEHMER WHERE BUCHUNG_ID =" & Recordset("buchung_id") & "and STATUS = 2 and DAILYPLAN = 1" , Connection
             if not rsRaum.EOF then
                    TeilnehmerNameExtern = rsRaum("NAME")
                    TeilnehmerFirmaExtern = rsRaum("FIRMA")
             end if
      rsRaum.close

My Problem:

I have a Booking, to that Booking i assign three Participants (TEILNEHMER). But if i try to display the Participants, the ASP is only displaying one of that three Participants, which i assigned to that booking.

What should i do to get all the Participants which are assigned to that booking? Do i have to loop also through that part of Code? I have tried but nothing worked.

Can Someone help me?

EDIT :

rsRaum.open  "SELECT NAME, FIRMA FROM TEILNEHMER WHERE BUCHUNG_ID =" & Recordset("buchung_id") & "and STATUS = 2 and DAILYPLAN = 1" , Connection
         if not rsRaum.EOF then



         do while not rsRaum.eof


                TeilnehmerNameExtern = rsRaum("NAME")
                TeilnehmerFirmaExtern = rsRaum("FIRMA")  

             rsRaum.movenext

          loop

         end if
  rsRaum.close

Upvotes: 0

Views: 11991

Answers (1)

ulluoink
ulluoink

Reputation: 2785

as you could have more than one teilnehmer you of course have to loop through that recordset. otherwise you will only get the first record

Upvotes: 1

Related Questions