Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Urgent - What does Set db = DbEngine(0)(0) mean??? 1

Status
Not open for further replies.

RenaissanceJo

Technical User
Sep 14, 2000
6
GB
I was having a problem turning off system messages when I was running a action query.

Some one from one of the access news groups told me to use:
Dim Db as DAO.Database
Set db = DbEngine(0)(0)

db.Execute ("NameOfYourQuery")

Are the first 2 lines safe because since using it, access 2k cant find ANY of my querys that I call from code??????

Thanks

Jo [sig][/sig]
 
Hope you have gotten a answer befor this, but just in case ...

The DBEngine(0)(0) is the archaic equivalent of "CurrentDb" for Ms. Access.

I don't undersatand why they are suggesting the DAO. part of the dimensioning, since you should be able to get the (desired) result with just the "Database". This MAY be different in 2K, but at least through 97 the DAO. in NOT necessary.

[sig]<p>MichaelRed<br><a href=mailto:mred@duvallgroup.com>mred@duvallgroup.com</a><br>There is never time to do it right but there is always time to do it over[/sig]
 
Precede the &quot;OpenQuery&quot; statement (DoCMD.OpenQuery.......) with a &quot;DoCMD.SetWarnings False&quot;

Run the query!

Follow up with another &quot;DoCMD.Setwarnings True&quot;

What this does is turn off all warning-type messages such as &quot;Query will modify contents of table,&quot; etc. for the duration of the query, then turn warnings back on. Warning: Be sure your queries and subsequent code are thoroughly debugged because you won't get any warnings if problems arise.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top