Results 1 to 8 of 8
  1. #1
    New Lounger
    Join Date
    Feb 2004
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    synchronization of forms and record sets (2002)

    Hi, I am wondering if i is possible to synchronise the bookmark of a form with the bookmark of an underlying recordset using ADO as it can be done in DAO?

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

    Re: synchronization of forms and record sets (2002)

    The simple answer is not exactly. If you are talking about the recordsetclone method of navigating through a form's recordset, that is strictly DAO. ADO has a Clone method for a recordset, but the resulting recordset isn't exactly the same thing as a DAO recordsetclone. If you use the combobox wizard to create the combo and select the option of Find a record on my form based on the value I selected in my combo box, you'll see the equivalent code for 2002. Here is an example created by the wizard for me:

    <pre>Private Sub cboOrderID_AfterUpdate()
    ' Find the record that matches the control.
    Dim rs As Object

    Set rs = Me.Recordset.Clone
    rs.FindFirst "[OrderID] = " & Str(Nz(Me![cboOrderID], 0))
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark
    End Sub</pre>

    Charlotte

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: synchronization of forms and record sets (2002)

    This is still DAO code - Clone is in DAO too, and FindFirst is strictly DAO, not ADO.

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

    Re: synchronization of forms and record sets (2002)

    Yes, you're correct. However, you can use this code without a DAO reference in Access 2002 because it is supported by the built-in DAO capabilities of the interface. Since forms bound to ADO recordsets are not updateable in mdbs and since you can't mix DAO and ADO recordsets, this is the method to use in an "ADO" database.
    Charlotte

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: synchronization of forms and record sets (2002)

    OK, good point.

  6. #6
    New Lounger
    Join Date
    Feb 2004
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: synchronization of forms and record sets (2002)

    Thanks guys - it seems that ADO isnt quite there yet with regard to its ability to accomplish the same outcomes as DAO. It seems that for the moment pure "ADO" databases are a bit of a way off - is this correct?

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: synchronization of forms and record sets (2002)

    Some things are much harder or impossible with ADO, so DAO is still needed. In Access 2003, there is a reference to the DAO object library by default again (see <!mskb=825796>Microsoft Knowledge Base Article 825796<!/mskb>), so it seems that Microsoft has come back from its intention to phase out DAO.

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

    Re: synchronization of forms and record sets (2002)

    It's quite possible to build a database without a DAO reference in 2002 but still use some built in DAO capabilities and references, you just have to use late binding, such as in the example code. ADO is designed to handle data, while DAO is designed to handle the Jet interface and Jet or ODBC data. The ADO model is vastly more flexible, but it isn't really intended for twiddling the interface, only the data. You can do some things with ADO that are impossible with DAO, and vice versa.
    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
  •