Jumat, 10 Agustus 2012

Re: [MS_AccessPros] "too many databases" and DBEngine(0)(0)

 

A quick, parallel question, to John and/or Crystal. Does "CodeDb" work the same way as "CurrentDb" by creating a copy?

(Microsoft's Help still, since Access 2000, says one should use CurrentDB rather than DBEngine(0)(0) ... "best practices", "best" for who? And why?)

--- In MS_Access_Professionals@yahoogroups.com, John Viescas <JohnV@...> wrote:
>
> Connie-
>
> CurrentDb returns a *copy* of the current database with all the collections
> refreshed. DBEngine(0)(0) references the current database without making a
> copy. The latter is a skosh faster, but may not reflect the latest changes to
> the collections (for example, if other code has added or deleted an object). If
> you Set db = CurrentDb, you should always Set db = Nothing before executing to
> release the copy.
>
> John Viescas, author
> Microsoft Office Access 2010 Inside Out
> Microsoft Office Access 2007 Inside Out
> Building Microsoft Access Applications
> Microsoft Office Access 2003 Inside Out
> SQL Queries for Mere Mortals
> http://www.viescas.com/
> (Paris, France)
>
>
>
>
> -----Original Message-----
> From: MS_Access_Professionals@yahoogroups.com
> [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of mrsgoudge
> Sent: Friday, August 10, 2012 9:57 PM
> To: MS_Access_Professionals@yahoogroups.com
> Subject: [MS_AccessPros] "too many databases" and DBEngine(0)(0)
>
> Crystal and all:
>
> I just saw this from Crystal:
>
> my experience has shown using DBEngine(0)(0) instead of CurrentDb when
> possible is a good idea to reduce the "too many databases open" error.
>
> How does one use DBEngine(0)(0)? I currently have two types of currentdb in my
> code and I'd like to change them:
>
> 1. Dim db As DAO.Database then "Set db = Currentdb)
>
> 2. CurrentDb.Execute "DELETE
>
> Thanks!
> Connie
>
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar