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) & "<br>" ***note*** 'Response.Write strHotelInfo & "<br>" 'Response.Write "We are here now!" 'Response.End If Not rstHotelInfo.EOF Then <<<<fails on this line with the code as is>>>> '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
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 <snip>
Don't see what you're looking for? Try a search.
|