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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ErrMsg "Either BOF or EOF is True" 1

Status
Not open for further replies.

ElvisIncognito

IS-IT--Management
Feb 23, 2002
6
US
Below are two virtually identical sets of code. Both queries work properly and return the expected recordsets when using Enterprise Manager, but while the first set (lines currently commented out) return the records in my ASP page, the second set returns the following error message:

Error Type:
ADODB.Field (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/80a/matrix4.asp, line 22

I've noted Line 22 below...


' Set rsPlatforms = Server.CreateObject("ADODB.Recordset")
Set rsTClist = Server.CreateObject("ADODB.Recordset")

' qryOSnames="SELECT os, Short FROM platforms WHERE ProdVer='" & strProdVer & "' ORDER BY OSID DESC"
qryTCnames="SELECT testcasenumname FROM testcases WHERE Prodver = '" & Prodver & "' AND priority = '0' ORDER BY TestCaseNumName"

' rsPlatforms.Open qryOSnames, connTestMatrix, adOpenKeySet
rsTClist.Open qryTCnames, connTestMatrix, adOpenKeySet

' Dim arrOS()
Dim arrTC()

' ReDim arrOS(6,1)
ReDim arrTC(100)

' For OScount = 1 to intOScount
For TCcount = 1 to 100

' arrOS(OScount,0) = rsPlatforms("os")
' arrOS(OScount,1) = rsPlatforms("Short")
LINE 22 -> arrTC(TCcount) = rsTClist("testcasenumname")

' Response.Write arrOS(OScount,0) & &quot;<BR>&quot;
Response.Write arrTC(TCcount) & &quot;<BR>&quot;

' rsPlatforms.MoveNext
rsTClist.MoveNext

' Next
Next

' rsPlatforms.Close
rsTClist.Close

' Set rsPlatforms= Nothing
Set rsTClist = Nothing
 
Should you be using a do while loop?

'Make sure you have records first
if not rsTCList.EOF then

'Roll throught the records you have
do while not rsTClist.EOF
Response.Write arrTC(TCcount) & &quot;<BR>&quot;
rsTClist.MoveNext
loop
end if
rsTClist.Close
 
Thanks for the response, Esoteric!

That doesn't make a lot of sense to me, since the other set of code (using a different query and recordset but otherwise identical) works properly, but I tried it using:

if not rsTCList.EOF then
do while not rsTClist.EOF
Response.Write arrTC(TCcount) & &quot;<BR>&quot;
rsTClist.MoveNext
loop
else
Response.Write &quot;rsTCList is at EOF!&quot;
end if
rsTClist.Close

and sure enough, it displayed &quot;rsTCList is at EOF!&quot;
so I prepended the code above with:

rsTCList.MoveFirst

I'm back to the same error message:

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

Again, both queries work properly when run in Enterprise Manager, and both queries return the expected results. I am utterly perplexed!!!
 
Have you tried printing out your second SQL statement to make sure it contains the values you think it contains?

I am not sure if this could be the problem, but in one of your SQL statements you use the variable strProdVer and in the second SQL statement you use the variable Prodver.

I would Response.write both of the SQL strings just to ensure the variables have the proper values.
 
That was it!!! You nailed it - it should've been strProdver. (I feel like such a moron!)

Thanks, JuanitaC!

Thank You! Thank You! Thank You! Thank You! Thank You! Thank You! Thank You! Thank You! Thank You! Thank You! Thank You! Thank You! Thank You! Thank You! Thank You! Thank You! Thank You! Thank You! Thank You! Thank You! Thank You! Thank You! Thank You! Thank You! Thank You! Thank You! Thank You! Thank You! Thank You! Thank You!

Thankyaveramuch!

~E
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top