• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 791
  • Last Modified:

DBEngine.compactdatabase won't work without Access Installed. Missing Reference ?

I have a VB6 project on a Windows 98 machine with SP6 installed. I am using MS Access 2000. When I do the compact everything is fine unless Access is not installed on the users machine. If I remove Access I get the error Activex component can't create object. There are no references marked as missing. Do I need to add a reference manually from somewhere ? I have tried adding and removing just about every reference on the list. And also P&D Wizard gives same results in package. Thanks.
0
tim522522522
Asked:
tim522522522
  • 5
  • 4
1 Solution
 
jadedataMS Access Systems CreatorCommented:
The MSAccess runtime engine components should be some of the references in your project.  The dbengine object, I do believe, is made available by and control through the DAO*.dll and some other components.  Without this the app can not instantiate the object.
0
 
flavoCommented:
Your right Jack,

dbengine is in the DAO3??.dll

Dave
0
 
tim522522522Author Commented:
I do see an Access 9.0 object library that is an included reference. This changes to MISSING when I remove Access. I then added it back in manually by copy and paste from the CD. This worked, the reference does not show as missing but the compact still doesn't work. So I guess there are other references I need, but I dont know what they are.

Some other references that are included are Visual Basic For Applications, OLE Automation among a few others. Does anyone know what I need to add and where to find it. Thanks.
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
flavoCommented:
If you're using VB, the Setup Wizard WILL pick up your references and include the necessary dlls.  When you install all will be sweet.

0
 
tim522522522Author Commented:
I have tried adding the DAO 3.51 & 3.60 references if that is what you mean? But I still have the same problem.
0
 
tim522522522Author Commented:
Flavo, I do use the Setup Wiz, I then install on a clean machine with no MS Access installed. It doesn't work.
0
 
flavoCommented:
Only add 1 of them

then use something like

Dim dbe As DAO.DBEngine
Set dbe = New DAO.DBEngine
   
    'compact
    dbe.CompactDatabase sourcefile, destfile
    'rename it back the way it was
    Kill sourcefile
    Name destfile As sourcefile

Set dbe = Nothing
0
 
flavoCommented:
DOes the DAO??Dll get registed on the "clean" pc.

0
 
tim522522522Author Commented:
Flavo, I reloaded everything clean and this time i did not reference Access 9.0 object library. Just DAO 3.6 and it works. Before I was referenceing both, I don't understand why this worked, mabey some conflict? I am new to this. Thanks it is working now.
0
 
flavoCommented:
Glad it all worked out mate
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now