error 80020009: Either BOF or EOF is True....

error 80020009: Either BOF or EOF is True....

am 07.12.2005 07:24:49 von gary.d.rezek

Hi All,
I know this error means the recordset is empty and I am trying to use it, but I am getting this error while
checking .EOF. The following code works if .EOF is false

If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
<<.....>>
Else 'it's not a post so let the form load with their db information if they have any
Set cnMain = Server.CreateObject("ADODB.Connection")
cnMain.Mode = 3
cnMain.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\FolderName\db_name.mdb;" & _
"User Id=admin;" & _
"Password=;"
strHotelInfo = "SELECT * "
strHotelInfo = strHotelInfo & "FROM HotelDisplayInformation "
strHotelInfo = strHotelInfo & "WHERE HotelPKID = " & lngHotelPKID
'-------------------------------------------------
Set rstHotelInfo = cnMain.Execute(strHotelInfo)
'Response.Write rstHotelInfo(1) & "
" ***note***
'Response.Write strHotelInfo & "
"
'Response.Write "We are here now!"
'Response.End
If Not rstHotelInfo.EOF Then <<<>>>
'load form with data
Else
'load form with empty strings
End If
***note*** >> will fail on this line, when uncommented, with Error Type: (0x80020009) Exception occurred.

I'm using ADO 2.8.

I'm probably missing something fairly simple, but I don't see it.
Thank you.

gdr
--
Gary D. Rezek
University Nerworking Systems and Services
South Dakota State University

Re: error 80020009: Either BOF or EOF is True....

am 07.12.2005 07:42:01 von gary.d.rezek

Ah-h-h-h. Couldn't see it for 2 hours, post a question and in 10 minutes find the cause of the error.
There was a misplaced reference to the recordset way outside the If...Then clause that I had been missing
somehow. Works fine when replaced with the string variable.
Thanks, sorry for the bother.

gdr