DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    nor Guest

    How to move to count record


    Hello...
    I've problem to count records in my table. I've try this

    dim recount
    objrec.movelast
    recount=objrec.recordcount
    objrec.movefirst

    but error returns:

    Microsoft OLE DB Provider for ODBC Drivers error '80040e24'
    The rowset does not support fetching backwards
    /hr/dbs/news.asp, line 25


  2. #2
    Kris Eiben Guest

    Re: How to move to count record

    Like it says, the type of recordset you've opened doesn't support fetching
    backwards. The default type is read-only, forward-only (or something like
    that). If you want to count records, it's probably more efficient to open 1
    rs that just returns count(insertTheNameOfYourIDField), then another
    recordset to get the records. Or open as a cursor type that supports
    rs.recordcount. See the FAQ for more info on this. www.aspfaq.com

    nor wrote in message <39f64ae3$1@news.devx.com>...
    >
    >Hello...
    >I've problem to count records in my table. I've try this
    >
    >dim recount
    >objrec.movelast
    >recount=objrec.recordcount
    >objrec.movefirst
    >
    >but error returns:
    >
    >Microsoft OLE DB Provider for ODBC Drivers error '80040e24'
    >The rowset does not support fetching backwards
    >/hr/dbs/news.asp, line 25
    >




  3. #3
    Frixos Kimonis Guest

    Re: How to move to count record

    Hello,

    You could use 'GetRows' i.e

    Dim strTable
    Dim numcols
    Dim numrows

    strTable=objRS.GetRows

    numcols=ubound(strTable,1)
    'Number of records retrieved
    numrows=ubound(strTable,2) + 1

    Frixos

    "nor" <aida_nor@hotmail.com> wrote in message
    news:39f64ae3$1@news.devx.com...
    >
    > Hello...
    > I've problem to count records in my table. I've try this
    >
    > dim recount
    > objrec.movelast
    > recount=objrec.recordcount
    > objrec.movefirst
    >
    > but error returns:
    >
    > Microsoft OLE DB Provider for ODBC Drivers error '80040e24'
    > The rowset does not support fetching backwards
    > /hr/dbs/news.asp, line 25
    >




Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links