Solved

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

Posted on 2004-08-03
10
746 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
10 Comments
 
LVL 32

Expert Comment

by:jadedata
ID: 11711148
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
ID: 11711292
Your right Jack,

dbengine is in the DAO3??.dll

Dave
0
 

Author Comment

by:tim522522522
ID: 11711296
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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
LVL 34

Expert Comment

by:flavo
ID: 11711310
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
ID: 11711332
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
 

Author Comment

by:tim522522522
ID: 11711338
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
ID: 11711345
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
ID: 11711349
DOes the DAO??Dll get registed on the "clean" pc.

0
 

Author Comment

by:tim522522522
ID: 11711463
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
ID: 11711497
Glad it all worked out mate
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

617 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