Results 1 to 6 of 6
  1. #1
    Lounger
    Join Date
    Dec 2000
    Location
    Nebraska
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Recordsets in Access 2000

    In Access 97 I used code like this to open a recordset and work with it:

    Dim db As Database
    Dim rst As Recordset
    Set db = CurrentDb
    Set rst = db.OpenRecordset("tblSelectedData")
    rst.MoveFirst

    In Access2000 I can

  2. #2
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    NYC,USA,Earth
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Recordsets in Access 2000

    As I am learning, A2k uses a different object model - ADO - than A97 uses - DAO. I believe one way to solve it is to make a reference to the microsoft DAO 3.6 Object Library. There are others here that are more conversive in this new model and may have other suggestions for you.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Recordsets in Access 2000

    Both DAO and ADO have a recordset object. Access thinks it recognizes the Recordset object, so it lets you dim it, but it chokes on Database because ADO doesn't have a Database object and you have the default ADO reference set. I'd recommend two things: 1) add the reference to DAO so that you can still write familiar code but can also learn the new object model along the way, and 2) start "disambiguating" your references all the time by declaring objects as DAO.Database and DAO.Recordset and DAO.Property to distinguish them from ADODB.Recordset and ADODB.Property.

    If you're only working with DAO, then it will be simple because all your model-specific objects (i.e., database, recordset, tabledef, querydef, field, property, etc.) can be declared as DAO.something. It will get you into the habit and will be a big help when you start working with ADO, since you'll be able to tell them apart. You don't have to do this with interface objects like form, control, report, module, but you do with the code-based objects.
    Charlotte

  4. #4
    Lounger
    Join Date
    Dec 2000
    Location
    Nebraska
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Recordsets in Access 2000

    Charlotte, thanks so much for your help. You'll never know how much you've done for me. Between answering my questions directly and all your posts for others, you have contributed a lot to my education.

    Paul

  5. #5
    Lounger
    Join Date
    Dec 2000
    Location
    Nebraska
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Recordsets in Access 2000

    Thanks Paul. I'd already tried that. As you can see below, Charlotte has the answer again. But I appreciate your comments.

    Paul

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Recordsets in Access 2000

    Glad to help. This is especially confusing to those who aren't full time developers like me. If you work with it every day, all day, it becomes second nature.
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •