Solved

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

Posted on 2006-07-07
6
819 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
  • 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

760 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now