Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Incognito
Starting Member
49 Posts |
Posted - 2002-03-21 : 06:35:22
|
| Hello,I need some advice for a loop: (getting a error message)This is the code:(using ASP and SQL server 2000)<%If RsContactMailing.EOF ThenDIM WaardeWaarde = 0While (((rsMilingen.Fields.Item("MailingID").Value) <> (rsContactMailing.Fields.Item("MailingID").Value)) AND (NOT RsContactMailing.EOF)) If (rsMilingen.Fields.Item("MailingID").Value) = (rsContactMailing.Fields.Item("MailingID").Value) ThenWaarde = 1End IfrsContactMailing.MoveNext()WendIf waarde = 1 ThenResponse.write "CHECKED"End IfElseResponse.write ""End If%>>The error is = Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.I'm sure there is data in the table.What the ****** am I doing wrong(Excusez moi).Thnx for all the help,GIA |
|
|
setbasedisthetruepath
Used SQL Salesman
992 Posts |
Posted - 2002-03-21 : 08:50:08
|
was this a typo?quote: <%If RsContactMailing.EOF Then
because it looks like you want to sayIf not RsContactMailing.EOF Then setBasedIsTheTruepath<O> |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-03-21 : 08:51:25
|
Well, your IF statement:If RsContactMailing.EOF Then...Will only run the code when it's reached the end of the recordset, so:rsContactMailing.MoveNext()will throw the exact error you're getting.Snipers! Get your head down! Edited by - robvolk on 03/21/2002 08:52:16 |
 |
|
|
Incognito
Starting Member
49 Posts |
Posted - 2002-03-21 : 09:33:16
|
| I changed my code:<%DIM WaardeWaarde = 0While (NOT RsContactMailing.EOF) If (rsMilingen.Fields.Item("MailingID").Value) = (rsContactMailing.Fields.Item("MailingID").Value) ThenWaarde = 1End IfrsContactMailing.MoveNext()WendIf waarde = 1 ThenResponse.write "CHECKED"Else Response.write("")End If%>>It still returns the same error. |
 |
|
|
|
|
|