Re: Using ADO and DAO in same mdb



John Winterbottom <john.wb@xxxxxxxxx> wrote in
news:5h64mnF3j9nppU1@xxxxxxxxxxxxxxxxxx:

Be aware that schema changes made through an ADO connection in
this way are not always immediately visible in DAO unless you
refresh the collection you're working with.

If you use a db variable initialized with CurrentDB() *after* the
collection has been updated, you won't need to refresh, as
CurrentDB() refreshes collections before returning its reference
(that's why it's slower than DBEngine(0)(0)).

On the other hand, if you use a db variable that was initialized
with CurrentDB() before updating the collections, you'll need to
refresh the appropriate colection, as John advises.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
.



Relevant Pages

  • Re: Updating Access data using SQL / refresh time question
    ... In DAO is not necessary refresh cache, but you can set the bookmark after ... > How would one go about refreshing a DAO recordset? ... > ' here I want to refresh the recordset so that the loading of the listview ...
    (microsoft.public.vb.database)
  • Re: tabellen erstellen -> tabelle nicht da
    ... >> den Refresh selbst nachschicken. ... >> des fehlenden Refreshs um so viel schneller. ... > damit die Database Instanz, die er anschliessend für das Recordset ... also eine /neue/ Instanz von CurrentDB ... ...
    (microsoft.public.de.access)
  • Re: tabellen erstellen -> tabelle nicht da
    ... >> Nach dem Anlegen der neuen Tabelle muss ein Refresh auf die Container ... der bei CurrentDB automatisch gemacht wird. ... > innerhalb der Transaktion noch abgeschlossen ist. ... eine Instanz von CurrentDB gebildet wird, gibt's den Refresh. ...
    (microsoft.public.de.access)
  • Re: Question from Access 2007 VBA by Hennig et al
    ... If Then Set dbC = CurrentDb() ... Dim Dbs As DAO.Database ... Set Dbs = CurrentDb ... forgetting to use Refresh and relying on CurrentDb ...
    (microsoft.public.access.modulesdaovba)
  • Re: Setting field properties in code
    ... Try using CurrentDb() in its place. ... > you will need to create a Database object or else the reference ... But if you're using DBEngine, all you have to do is refresh the ...
    (comp.databases.ms-access)