Solved

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

Posted on 2004-08-03
10
697 Views
Last Modified: 2012-05-05
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
Comment
Question by:tim522522522
  • 5
  • 4
10 Comments
 
LVL 32

Expert Comment

by:jadedata
Comment Utility
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
 
LVL 34

Expert Comment

by:flavo
Comment Utility
Your right Jack,

dbengine is in the DAO3??.dll

Dave
0
 

Author Comment

by:tim522522522
Comment Utility
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
 
LVL 34

Expert Comment

by:flavo
Comment Utility
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
 

Author Comment

by:tim522522522
Comment Utility
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:tim522522522
Comment Utility
Flavo, I do use the Setup Wiz, I then install on a clean machine with no MS Access installed. It doesn't work.
0
 
LVL 34

Accepted Solution

by:
flavo earned 500 total points
Comment Utility
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
 
LVL 34

Expert Comment

by:flavo
Comment Utility
DOes the DAO??Dll get registed on the "clean" pc.

0
 

Author Comment

by:tim522522522
Comment Utility
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
 
LVL 34

Expert Comment

by:flavo
Comment Utility
Glad it all worked out mate
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now