Solved

ActiveX componet can't create object error

Posted on 2004-08-10
11
746 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
 
LVL 15

Expert Comment

by:SRigney
ID: 11763407
Does the client machine have the same version of Access installed?
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 69

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 69

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 69

Expert Comment

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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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 need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now