Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

read table with DAO sequentially on my secondary index

Discussion in 'Information Technology' started by Doug F., Jul 28, 2006.

  1. Doug F.

    Doug F.
    Expand Collapse
    Guest

    I want to read through a table with DAO sequentially using the .movefirst
    ..move next constructs either by (a) the primary key sequence or by (b) the
    secondary key sequence. Thanks.

    --
    Doug F.
     
  2. Loading...

    Similar Threads Forum Date
    Literature Has Anyone Read: "The Sikh Religion: Its Gurus, Sacred Writings And Authors" Language, Arts & Culture Oct 22, 2016
    Does Reading Baani Magically Affect Our Body And Psyche? And Does The Effect Depend On The Bani Read Intellectual Translations by SPNers Apr 30, 2016
    Sikhi Am I Ready To Take Amrit? Sikh Sikhi Sikhism Mar 10, 2016
    Emphasis When Reading Gurbani Intellectual Translations by SPNers Feb 14, 2016
    General Help! Looking for a good clairvoyant/card reader......any suggestions? Please Blogs Jan 25, 2016

  3. Douglas J. Steele

    Douglas J. Steele
    Expand Collapse
    Guest

    Create a query that has the appropriate ORDER BY clause in it, and use that
    to open your recordset.

    There's no guarantee what order the records will come back in otherwise.

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no private e-mails, please)


    "Doug F." <DougF@discussions.microsoft.com> wrote in message
    news:6B51CB68-7CDF-4FEE-9EEC-1B7B93B6AA30@microsoft.com...
    >I want to read through a table with DAO sequentially using the .movefirst
    > .move next constructs either by (a) the primary key sequence or by (b) the
    > secondary key sequence. Thanks.
    >
    > --
    > Doug F.
     
  4. Doug F.

    Doug F.
    Expand Collapse
    Guest

    Thank you muchly.
    --
    Doug F.


    "Douglas J. Steele" wrote:

    > Create a query that has the appropriate ORDER BY clause in it, and use that
    > to open your recordset.
    >
    > There's no guarantee what order the records will come back in otherwise.
    >
    > --
    > Doug Steele, Microsoft Access MVP
    > http://I.Am/DougSteele
    > (no private e-mails, please)
    >
    >
    > "Doug F." <DougF@discussions.microsoft.com> wrote in message
    > news:6B51CB68-7CDF-4FEE-9EEC-1B7B93B6AA30@microsoft.com...
    > >I want to read through a table with DAO sequentially using the .movefirst
    > > .move next constructs either by (a) the primary key sequence or by (b) the
    > > secondary key sequence. Thanks.
    > >
    > > --
    > > Doug F.

    >
    >
    >
     
  5. Doug F.

    Doug F.
    Expand Collapse
    Guest

    Oops, when I try this:
    Dim dbs As Database
    Dim rst As DAO.Recordset
    Set dbs = CurrentDb()
    Set rst = dbs.OpenRecordset("my_query_name", dbOpenTable)

    I get an error 'invalid operation'. I'm using a .mdb, it seems source must
    be a table.

    --
    Doug F.


    "Doug F." wrote:

    > Thank you muchly.
    > --
    > Doug F.
    >
    >
    > "Douglas J. Steele" wrote:
    >
    > > Create a query that has the appropriate ORDER BY clause in it, and use that
    > > to open your recordset.
    > >
    > > There's no guarantee what order the records will come back in otherwise.
    > >
    > > --
    > > Doug Steele, Microsoft Access MVP
    > > http://I.Am/DougSteele
    > > (no private e-mails, please)
    > >
    > >
    > > "Doug F." <DougF@discussions.microsoft.com> wrote in message
    > > news:6B51CB68-7CDF-4FEE-9EEC-1B7B93B6AA30@microsoft.com...
    > > >I want to read through a table with DAO sequentially using the .movefirst
    > > > .move next constructs either by (a) the primary key sequence or by (b) the
    > > > secondary key sequence. Thanks.
    > > >
    > > > --
    > > > Doug F.

    > >
    > >
    > >
     
  6. Rick Brandt

    Rick Brandt
    Expand Collapse
    Guest

    Doug F. wrote:
    > Oops, when I try this:
    > Dim dbs As Database
    > Dim rst As DAO.Recordset
    > Set dbs = CurrentDb()
    > Set rst = dbs.OpenRecordset("my_query_name", dbOpenTable)
    >
    > I get an error 'invalid operation'. I'm using a .mdb, it seems source
    > must be a table.


    Try dbOpenDynaset
     
  7. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    Just get rid of the dbOpenTable parameter.

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no e-mails, please!)


    "Doug F." <DougF@discussions.microsoft.com> wrote in message
    news:EAABFE48-6090-4417-8F4D-E0A4AC8A4173@microsoft.com...
    > Oops, when I try this:
    > Dim dbs As Database
    > Dim rst As DAO.Recordset
    > Set dbs = CurrentDb()
    > Set rst = dbs.OpenRecordset("my_query_name", dbOpenTable)
    >
    > I get an error 'invalid operation'. I'm using a .mdb, it seems source must
    > be a table.
    >
    > --
    > Doug F.
    >
    >
    > "Doug F." wrote:
    >
    > > Thank you muchly.
    > > --
    > > Doug F.
    > >
    > >
    > > "Douglas J. Steele" wrote:
    > >
    > > > Create a query that has the appropriate ORDER BY clause in it, and use

    that
    > > > to open your recordset.
    > > >
    > > > There's no guarantee what order the records will come back in

    otherwise.
    > > >
    > > > --
    > > > Doug Steele, Microsoft Access MVP
    > > > http://I.Am/DougSteele
    > > > (no private e-mails, please)
    > > >
    > > >
    > > > "Doug F." <DougF@discussions.microsoft.com> wrote in message
    > > > news:6B51CB68-7CDF-4FEE-9EEC-1B7B93B6AA30@microsoft.com...
    > > > >I want to read through a table with DAO sequentially using the

    ..movefirst
    > > > > .move next constructs either by (a) the primary key sequence or by

    (b) the
    > > > > secondary key sequence. Thanks.
    > > > >
    > > > > --
    > > > > Doug F.
    > > >
    > > >
    > > >
     
  8. Doug F.

    Doug F.
    Expand Collapse
    Guest

    Rick and Doug, thank you.
    --
    Doug F.


    "Douglas J Steele" wrote:

    > Just get rid of the dbOpenTable parameter.
    >
    > --
    > Doug Steele, Microsoft Access MVP
    > http://I.Am/DougSteele
    > (no e-mails, please!)
    >
    >
    > "Doug F." <DougF@discussions.microsoft.com> wrote in message
    > news:EAABFE48-6090-4417-8F4D-E0A4AC8A4173@microsoft.com...
    > > Oops, when I try this:
    > > Dim dbs As Database
    > > Dim rst As DAO.Recordset
    > > Set dbs = CurrentDb()
    > > Set rst = dbs.OpenRecordset("my_query_name", dbOpenTable)
    > >
    > > I get an error 'invalid operation'. I'm using a .mdb, it seems source must
    > > be a table.
    > >
    > > --
    > > Doug F.
    > >
    > >
    > > "Doug F." wrote:
    > >
    > > > Thank you muchly.
    > > > --
    > > > Doug F.
    > > >
    > > >
    > > > "Douglas J. Steele" wrote:
    > > >
    > > > > Create a query that has the appropriate ORDER BY clause in it, and use

    > that
    > > > > to open your recordset.
    > > > >
    > > > > There's no guarantee what order the records will come back in

    > otherwise.
    > > > >
    > > > > --
    > > > > Doug Steele, Microsoft Access MVP
    > > > > http://I.Am/DougSteele
    > > > > (no private e-mails, please)
    > > > >
    > > > >
    > > > > "Doug F." <DougF@discussions.microsoft.com> wrote in message
    > > > > news:6B51CB68-7CDF-4FEE-9EEC-1B7B93B6AA30@microsoft.com...
    > > > > >I want to read through a table with DAO sequentially using the

    > ..movefirst
    > > > > > .move next constructs either by (a) the primary key sequence or by

    > (b) the
    > > > > > secondary key sequence. Thanks.
    > > > > >
    > > > > > --
    > > > > > Doug F.
    > > > >
    > > > >
    > > > >

    >
    >
    >
     

Share This Page