Solved

I am getting "Object doesn't support this property or method: 'Eof'" on an ADODB.recordset.

Posted on 2006-07-07
6
872 Views
Last Modified: 2009-07-29
I am getting "Object doesn't support this property or method: 'Eof'" on this recordset that I have created.  I can not seem to find the error in my code to cause this.  I check the Stored procedure and it is returning more then one row.

Can anyone see what I did wrong and how to get this to work?

Thanks


<%
                    Dim cmdFreeTicketInfo
                    Dim rsFreeTicketInfo
                    set cmdFreeTicketInfo = server.CreateObject("ADODB.Command")
                        cmdFreeTicketInfo.CommandText = "selFreeTicketInfo"
                        cmdFreeTicketInfo.CommandType =adCmdStoredProc
                        cmdFreeTicketInfo.ActiveConnection = objConn
                        cmdFreeticketInfo.Parameters.append cmdFreeTicketInfo.CreateParameter("@idProduction", adInteger, adParamInput, 4, request.QueryString("idProduction"))
                    set rsFreeTicketInfo = server.CreateObject("ADODB.recordset")
                        rsFreeTicketInfo.CursorType = adUseClient
                        rsFreeTicketInfo.LockType = adLockReadOnly
                        rsFreeTicketInfo = cmdFreeTicketInfo.Execute
                       

%>
                            <table width=645 bgcolor="#ABDAEO">
                                <tr>
                                    <td colspan=2 class="smheaderboldsl">
                                    <%= rsFreeTicketInfo("fldTitle") %>, <%= rsFreeTicketInfo("fldDateTime") %>
                                       
                                    </td>                                
                                </tr>

<%
   
                        if rsFreeTicketInfo.EOF then
%>
                                <tr>
                                    <td colspan=2 class="smheaderboldsl">
                                    Sorry you have no patrons right now.
                                       
                                    </td>                                
                                </tr>
<%
                        else
                            do
%>    
                           
                            <tr>
                                <td width=545 class="reg9slbl">
                                    <%= rsFreeTicketInfo("fldName") %><br />
                                    <%= rsFreeTicketInfo("fldPhoneNumber") %>
                                </td>
                                <td width=100 class="reg9slbl">
                                    <%= rsFreeTicketInfo("fldTicketNumber") %>
                                </td>
                            </tr>
<%
                            rsFreeTicketInfo.MoveNext
                            loop until rsFreeTicketInfo.EOF
                          end if
%>


                            </table>
0
Comment
Question by:GabicusC
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 1

Expert Comment

by:tlp560
ID: 17060457
try this instead
<%
   
                        if rsFreeTicketInfo.EOF then
%>
                            <tr>
                                <td colspan=2 class="smheaderboldsl">
                                Sorry you have no patrons right now.
                                   
                                </td>                            
                            </tr>
<%
                        else
                            do until rsFreeTicketInfo.EOF
%>    
                           
                            <tr>
                                <td width=545 class="reg9slbl">
                                    <%= rsFreeTicketInfo("fldName") %><br />
                                    <%= rsFreeTicketInfo("fldPhoneNumber") %>
                                </td>
                                <td width=100 class="reg9slbl">
                                    <%= rsFreeTicketInfo("fldTicketNumber") %>
                                </td>
                            </tr>
<%
                            rsFreeTicketInfo.MoveNext
                            loop
                          end if
%>
0
 

Author Comment

by:GabicusC
ID: 17060527
Thanks tlp560 for your reply,

I am still getting the same error.  It is really odd because when I am writing the code it give me all the option for a recordset.  It is just when I run the code this error kicks in.
0
 
LVL 14

Accepted Solution

by:
CyrexCore2k earned 500 total points
ID: 17060732
The beginning bit should be

                    Dim cmdFreeTicketInfo
                    Dim rsFreeTicketInfo
                    set cmdFreeTicketInfo = server.CreateObject("ADODB.Command")
                        cmdFreeTicketInfo.CommandText = "selFreeTicketInfo"
                        cmdFreeTicketInfo.CommandType =adCmdStoredProc
                        cmdFreeTicketInfo.ActiveConnection = objConn
                        cmdFreeticketInfo.Parameters.append cmdFreeTicketInfo.CreateParameter("@idProduction", adInteger, adParamInput, 4, request.QueryString("idProduction"))
                        rsFreeTicketInfo.CursorType = adUseClient
                        rsFreeTicketInfo.LockType = adLockReadOnly
                        Set rsFreeTicketInfo = cmdFreeTicketInfo.Execute
0
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
LVL 1

Expert Comment

by:tlp560
ID: 17060763
I'm using a similar app. like yours now ... the codes are similar, except on these lines, I've "set " which you don't ... something like this:

            set objCmd = server.CreateObject("ADODB.Command")
            set objCmd.ActiveConnection = objConn
            objCmd.CommandText = "sp_GetCode"
            objCmd.CommandType = adCmdStoredProc

            set objPrm = objCmd.CreateParameter("number_ID", adVarChar, adParamInput, 15,Trim(Request.Form("number_id")))
            objCmd.Parameters.Append objPrm
      
            set myRS = objCmd.Execute
0
 
LVL 1

Expert Comment

by:tlp560
ID: 17060873
that's it! look at CyrexCore2k ... that should work!

:-)
0
 

Author Comment

by:GabicusC
ID: 17061087
Thank you CyrexCore2K,

I had a feeling that it was a simple fix.  I just was not seeing it.

GabicusC
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question