Can't use CurrentDB object

  • Thread starter Thread starter Kipp Woodard
  • Start date Start date
K

Kipp Woodard

I have a customer who is using Access 2000, SP1. He gets an error message
when using the CurrentDB object in code. I think the message says something
about ActiveX.

Any ideas?
 
Kipp Woodard said:
I have a customer who is using Access 2000, SP1. He gets an error
message when using the CurrentDB object in code. I think the message
says something about ActiveX.

Any ideas?

I'm not sure what the message may be saying, but make sure that he has a
reference set to the Microsoft DAO 3.6 Object Library, and that the DAO
objects (Database, Recordset, Field, Property, etc.) he may be using are
declared with the DAO qualifier; e.g.,

Dim db As DAO.Database
Dim rs As DAO.Recordset

and so on.

Also, if your customer is working in a an ADP, rather than an MDB file,
then there *is* no CurrentDb and the function will return Nothing.
 
Thanks.

DAO 3.6 is referenced and it looks good. It is a regular MDB. I even
created a new MDB, and this code fails on the Set.

Public Sub MySub()
Dim db as DAO.Database

Set db = CurrentDB
End Sub

Thx for your help.
 
Kipp Woodard said:
Thanks.

DAO 3.6 is referenced and it looks good. It is a regular MDB. I even
created a new MDB, and this code fails on the Set.

Public Sub MySub()
Dim db as DAO.Database

Set db = CurrentDB
End Sub

Thx for your help.

Does it work on your PC and not on the customer's? If so, I'd look for
a broken reference at the customer's site -- something about his
configuration that is different from yours, that is interfering with the
proper evaluation of references. Are you familiar with the process of
debugging reference problems? If not, see this link:


http://members.rogers.com/douglas.j.steele/AccessReferenceErrors.html

If the problem shows up in a brand new database, with DAO the only
reference added above the default, it seems logical that the customer
has a nonstandard -- if not broken -- installation of Office/Access.
Somewhere I've seen posted a link to a reference-checker utility; you
may want to check the Access Web (www.mvps.org/access/) or Tony Toews'
site (http://www.granite.ab.ca/accsmstr.htm) for that.
 
Hi Kipp,

Try re-registering DAO360.dll:

Follow these steps to use Regsvr32.exe to register the Data Access Objects
(DAO) DLL on your computer:
1- Quit Microsoft Access if it is running.
2- Verify that Regsvr32.exe is in your Windows\System folder, for example:
C:\Windows\System

-or-

\Winnt\System32

3- Click Start, and then click Run.
4- In the Run dialog box, type the following command:
Regsvr32.exe C:\progra~1\common~1\micros~1\dao\dao360.dll

NOTE: The path to Dao360.dll may be different on your computer, depending
upon which folder you installed Microsoft Office in. Start Microsoft
Access, and then try to perform the process that caused the error.

Source: ACC2000: Invalid DAO Reference Causes Fatal Error in MSACCESS
http://support.microsoft.com/default.aspx?scid=kb;en-us;248790

I hope this helps! If you have additional questions on this topic, please
respond back to this posting.


Regards,

Eric Butts
Microsoft Access Support

"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
<http://www.microsoft.com/security/security_bulletins/ms03-026.asp> and/or
to visit Windows Update at <http://windowsupdate.microsoft.com/> to install
the patch. Running the SCAN program from the Windows Update site will help
to insure you are current with all security patches, not just MS03-026."



--------------------
| From: "Kipp Woodard" <[email protected]>
| Subject: Can't use CurrentDB object
| Date: Wed, 4 Feb 2004 11:17:24 -0600
| Lines: 10
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <#[email protected]>
| Newsgroups: microsoft.public.access.formscoding
| NNTP-Posting-Host: router.appliedolap.com 207.111.170.180
| Path:
cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.
phx.gbl
| Xref: cpmsftngxa07.phx.gbl microsoft.public.access.formscoding:219175
| X-Tomcat-NG: microsoft.public.access.formscoding
|
| I have a customer who is using Access 2000, SP1. He gets an error message
| when using the CurrentDB object in code. I think the message says
something
| about ActiveX.
|
| Any ideas?
|
| --
| Kipp Woodard
|
|
|
 
Dirk Goldgar said:
Does it work on your PC and not on the customer's? If so, I'd look
for a broken reference at the customer's site -- something about his
configuration that is different from yours, that is interfering with
the proper evaluation of references. Are you familiar with the
process of debugging reference problems? If not, see this link:


http://members.rogers.com/douglas.j.steele/AccessReferenceErrors.html

If the problem shows up in a brand new database, with DAO the only
reference added above the default, it seems logical that the customer
has a nonstandard -- if not broken -- installation of Office/Access.
Somewhere I've seen posted a link to a reference-checker utility; you
may want to check the Access Web (www.mvps.org/access/) or Tony Toews'
site (http://www.granite.ab.ca/accsmstr.htm) for that.

Actually, the reply from Eric Butts ("prabha") looks like a much more
likely answer to your problem. Please try that approach first.
 
Back
Top