Welcome to SPN

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

Sign Up Now!
  1. Guest ji, please consider donating today!   Become a Supporter    ::   Make a Contribution   
    Monthly (Recurring) Target: $300 :: Achieved: $95

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
    Can This Thread Be Deleted Questions and Answers Jan 3, 2017
    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

  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.
    > > > >
    > > > >
    > > > >

    >
    >
    >
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page