Solved

ActiveX componet can't create object error

Posted on 2004-08-10
11
753 Views
Last Modified: 2008-01-09
I have a VB6 program that calls a Access 2000 report and saves it out as a snapshot file for viewing.
This works great on my development PC but when I create an install package I get the following error when I trying to call the report:

    "ActiveX componet can't create object"

I have referenced the Access library in my project.
I'm using late binding to call Access. Should I be using the Createobject function?

any help or suggestion would be great.
thanks.

0
Comment
Question by:stacey14
[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
  • 3
  • 2
  • 2
  • +1
11 Comments
 
LVL 53

Expert Comment

by:Dhaest
ID: 11762462
Can you post  a little bit of your code ?

If you're using late binding (so no reference in your project), then you need to use createObject("access.application")
0
 
LVL 15

Expert Comment

by:SRigney
ID: 11763038
Are you sure it's having a problem with the Access component?  It may be another component.

Something I do when this occurs is I catch error messages for each item to narrow down the problem

For Example.
Privat Sub DoSomething()

  On Error Resume Next
  Dim rs As ADODB.Recordset
  Set rs = New ADODB.Recordset
  If Err.Number <> 0 Then
    MsgBox "Failed to create the ADO Recordset object!"
    Exit Sub
  End If

   On Error Goto StandardError
   ' Do other processing here.

  On Error Resume Next
   Dim acc As SomeObject
   Set acc = New SomeObject
  If Err.Number <> 0 Then
    MsgBox "Failed to create the SomeObject object!"
    Exit Sub
  End If

   On Error Goto StandardError
   ' Do more processing here.

   Exit Sub
StandardError:
   MsgBox Err.Number & ": " & Err.Description
End Sub
0
 

Author Comment

by:stacey14
ID: 11763390
I don't have the code in front of me but its something like this:

dim objAcc as access.application

set objAcc = new access.appliation

with objAcc
    .docmd.openreport "report name", "parameters here"
    .docmd.outputto "the name of the file", "other parameters", etc
    .quit
end with

set objAcc = nothing

again with it not being in front of me its not verbatim. And like I said it works great when I test it in development but not from a client install.
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 15

Expert Comment

by:SRigney
ID: 11763407
Does the client machine have the same version of Access installed?
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 11763591
The setup package does not distribute anything you use through Automation (Word, Excel, Access, ...). You have to make sure that users PCs have all required applications already installed.
0
 

Author Comment

by:stacey14
ID: 11790150
this may be a dumb question but I'll ask it anyway because this may come up while installing on client machines...for this to work do the clients have to have Access installed on their machine? I know to access data from an Access database they don't have to have it but I'm not sure about calling a report without Access being installed.
If its possible, what steps do I need to do in order for that to work?
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 100 total points
ID: 11791477
Yes. That is what we said before. Access has to be installed to use the reports. The installation of Access cannot be included into your own package. You have to ask the client to install Office (and particularly Access) and your application separately and everything should work.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 12377151
points to emoreau
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month10 days, 15 hours left to enroll

628 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