Solved

ActiveX componet can't create object error

Posted on 2004-08-10
11
749 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
  • 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB error "Type mismatch" 2 59
VBA error replacing data 6 40
Paint/Redraw window while dragging 16 82
Using "ScreenUpdating" 6 73
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

839 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