Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2006-07-07
6
Medium Priority
?
890 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 2000 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

721 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