Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. fetching backward

fetching backward

Scheduled Pinned Locked Moved Database
databasehelpcomsysadminquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hesham Amin
    wrote on last edited by
    #1

    hi all i open an access database from asp .. for some reason i need to know the number of records in the recordset before processing it as follows : set con=Server.CreateObject("Adodb.Connection") set rs=Server.CreateObject("Adodb.Recordset") con.ConnectionString=strCon con.CursorLocation=1 'server con.Open set rs.ActiveConnection=con rs.CursorType=adOpenKeySet rs.open "select * from items" rs.MoveLast n=rs.RecordCount Response.Write n i get an error : Microsoft OLE DB Provider for ODBC Drivers (0x80040E24) Rowset does not support fetching backward. can you help with this ?

    K 1 Reply Last reply
    0
    • H Hesham Amin

      hi all i open an access database from asp .. for some reason i need to know the number of records in the recordset before processing it as follows : set con=Server.CreateObject("Adodb.Connection") set rs=Server.CreateObject("Adodb.Recordset") con.ConnectionString=strCon con.CursorLocation=1 'server con.Open set rs.ActiveConnection=con rs.CursorType=adOpenKeySet rs.open "select * from items" rs.MoveLast n=rs.RecordCount Response.Write n i get an error : Microsoft OLE DB Provider for ODBC Drivers (0x80040E24) Rowset does not support fetching backward. can you help with this ?

      K Offline
      K Offline
      karl_w
      wrote on last edited by
      #2

      You could call SELECT COUNT(*) FROM items first and then your actual query. -- karl

      H 1 Reply Last reply
      0
      • K karl_w

        You could call SELECT COUNT(*) FROM items first and then your actual query. -- karl

        H Offline
        H Offline
        Hesham Amin
        wrote on last edited by
        #3

        I've already decided to use this method.. I know it but I didn't want to make 2 queries while I can use a simple property call thank you anyway :) any other ideas ?

        A 1 Reply Last reply
        0
        • H Hesham Amin

          I've already decided to use this method.. I know it but I didn't want to make 2 queries while I can use a simple property call thank you anyway :) any other ideas ?

          A Offline
          A Offline
          andyharman
          wrote on last edited by
          #4

          You might read up on the following: o CursorType = adStatic (3) o CursorLocation = adUseClient (3) Also, when I was doing ASP, I used to use the GetRows() method to store the recordset into a multi-dimensional array. That allows you to close the recordset and connection straight away - and you can wander backwards and forwards through the array data. Andy

          H 1 Reply Last reply
          0
          • A andyharman

            You might read up on the following: o CursorType = adStatic (3) o CursorLocation = adUseClient (3) Also, when I was doing ASP, I used to use the GetRows() method to store the recordset into a multi-dimensional array. That allows you to close the recordset and connection straight away - and you can wander backwards and forwards through the array data. Andy

            H Offline
            H Offline
            Hesham Amin
            wrote on last edited by
            #5

            Hi.. I changed the driver in the connection string from Microsoft access to: Jet 4.0 and it worked !!

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups