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

ActiveX componet can't create object error

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
stacey14
Asked:
stacey14
  • 3
  • 2
  • 2
  • +1
1 Solution
 
DhaestCommented:
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
 
SRigneyCommented:
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
 
stacey14Author Commented:
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
SRigneyCommented:
Does the client machine have the same version of Access installed?
0
 
Éric MoreauSenior .Net ConsultantCommented:
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
 
stacey14Author Commented:
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
 
Éric MoreauSenior .Net ConsultantCommented:
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
 
Éric MoreauSenior .Net ConsultantCommented:
points to emoreau
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now