Solved

ActiveX componet can't create object error

Posted on 2004-08-10
11
748 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

776 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