[AccessD] OpenRecordSet question

Stuart McLachlan stuart at lexacorp.com.pg
Sun Aug 9 06:14:51 CDT 2009


Also  this from Access 2003 VBA Help:

Note In previous versions of Microsoft Access, you may have used the syntax 
DBEngine.Workspaces(0).Databases(0) or DBEngine(0)(0) to return a pointer 
to the current database. In Microsoft Access 2000, you should use the CurrentDb 
method instead. The CurrentDb method creates another instance of the current 
database, while the DBEngine(0)(0) syntax refers to the open copy of the current 
database. The CurrentDb method enables you to create more than one variable of type 
Database that refers to the current database. Microsoft Access still supports the 
DBEngine(0)(0) syntax, but you should consider making this modification to your 
code in order to avoid possible conflicts in a multiuser database.

So I'm going to stick with CurrentDB unless I am looking at a speed critical application.

-- 
Stuart

On 9 Aug 2009 at 12:36, Gustav Brock wrote:

> 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
> 
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com





More information about the AccessD mailing list