A.D.Tejpal
adtp at airtelmail.in
Mon Aug 10 03:31:56 CDT 2009
Gustav, It seems that in order to get the revised status, say count of records after executing an append query, refresh method of pertinent collection needs to be called anyway, whether the pointer pertains to CurrentDb or DbEngine. If db1 and db2 are two object variables pointing to CurrentDb, and an append query has been executed via db1, latest status obtained by refresh of tabledefs via db1 (say db1.TableDefs.Refresh) is not transparent to db2. For db2 also to see the uptodate position, explicit statement like db2.TableDefs.Refresh becomes necessary. The statement db1 Is db2 returns False. On the other hand, if db1 and db2 point to DbEngine(0)(0), latest status resulting from refresh of tabledefs collection via db1 is directly seen by db2 as well. There is no need for a separate refresh via db2. The statement db1 Is db2 returns True. Best wishes, A.D. Tejpal ------------ ----- Original Message ----- From: Gustav Brock To: accessd at databaseadvisors.com Sent: Monday, August 10, 2009 03:17 Subject: Re: [AccessD] OpenRecordSet question Hi Max Well ... no. That certainly depends. You just need to know what you are doing. /gustav >>> max.wanadoo at gmail.com 09-08-2009 18:05:05 >>> Thanks Gustav. I think the later posts from Stuart clarify the situation. Back to good old CurrentDB then. Max -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: 09 August 2009 11:36 To: accessd at databaseadvisors.com Subject: Re: [AccessD] OpenRecordSet question Hi Max A surprise is waiting you. Try to, say, create a table by calling another function and read it from your db object; it isn't there until you do a db.Refresh. So: .. you ARE actually looking at the DB object as is when initialized or refreshed - including subsequent changes made in the current context. /gustav >>> max.wanadoo at gmail.com 09-08-2009 12:03 >>> Very interesting John, FWIW my results hover around the 150 mark ?? DBENGINE is 1. So, clearly the answer is to Set db = DBEngine(0)(0). That way you will know that you ARE actually looking at the DB as it exists and not as it DID exist at the time when the object was created. Thanks for the effort. Max