Cannot create ActiveX component

Cannot create ActiveX component

Page 1 of 1

6 Replies - 3906 Views - Last Post: 02 September 2010 - 09:46 AM Rate Topic: -----

#1 georgej28  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 13-July 10

Cannot create ActiveX component

Posted 01 September 2010 - 10:28 AM

References
Microsoft Office 9.0 Object Library
Microsoft ADO Ext. 2.8 for DLL and Security
Microsoft ActiveX Data Objects 2.8 library

I have a VS 2005 VB.net windows application, I need to run a macro in a Microsoft Access 2000 database.
When I run the code below I recieve the following message.

Error Cannot create ActiveX component

Dim oAccess As Object

        oAccess = CreateObject("Access.Application") --Error Cannot create ActiveX component.
        oAccess.OpenCurrentDatabase("Z:\AAA.mdb")

        oAccess.DoCmd.RunMAcro("MacPrint")
        oAccess.DoCmd.Maximize()
        oAccess.Visible = True

This post has been edited by JackOfAllTrades: 01 September 2010 - 01:31 PM
Reason for edit:: Added code tags.


Is This A Good Question/Topic? 0
  • +

Replies To: Cannot create ActiveX component

#2 parbipin  Icon User is offline

  • D.I.C Head

Reputation: 29
  • View blog
  • Posts: 95
  • Joined: 23-August 10

Re: Cannot create ActiveX component

Posted 01 September 2010 - 10:57 AM

Add References > On the COM tab, locate Microsoft Access 10.0 Object Library

Also use code tags when posting code, it makes it more readable, Thanks

This is link should be sufficient for you: MSDN Help

This is actually VB.Net and not VB6, So next time post your VB.Net question in the relevant Forum please, you will get better response time.

Good Luck, Hope it Helps

This post has been edited by parbipin: 01 September 2010 - 10:59 AM

Was This Post Helpful? 0
  • +
  • -

#3 georgej28  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 13-July 10

Re: Cannot create ActiveX component

Posted 01 September 2010 - 01:23 PM

Problem, I don't have MS Access installed on the development machine and the company no longer has its software install disk. Hence no, Microsoft Access 10.0 Object Library. What I have is ms access installed on a machine on the network with the database and access to its dll's. Can I write and api call to those .dlls? Is so which one do I use? I just need to print a report in that database.
Was This Post Helpful? 0
  • +
  • -

#4 thava  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 180
  • View blog
  • Posts: 1,606
  • Joined: 17-April 07

Re: Cannot create ActiveX component

Posted 01 September 2010 - 07:41 PM

i think this will solve your problem

http://msdn.microsof...28VS.90%29.aspx
Was This Post Helpful? 0
  • +
  • -

#5 parbipin  Icon User is offline

  • D.I.C Head

Reputation: 29
  • View blog
  • Posts: 95
  • Joined: 23-August 10

Re: Cannot create ActiveX component

Posted 02 September 2010 - 05:48 AM

@thava: I think he would still need the application object library installed on his PC. I don't thin He can initialize an object that's not available because the system wouldn't recognize it.

@georgej28: If you do not have the MS Access retail version installed on your system. Then you atleast need to have MsAccess Run Time installed. That will get you access to these libraries. These run time files can only be created by someone who has the developer version MsAccess installed on their PC using the Microsoft Office Developer Tools .

Have a look at this link and search for the Heading: Automating Access Runtime

MSDN Reference

Hope it helps!!!

This post has been edited by parbipin: 02 September 2010 - 05:53 AM

Was This Post Helpful? 0
  • +
  • -

#6 thava  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 180
  • View blog
  • Posts: 1,606
  • Joined: 17-April 07

Re: Cannot create ActiveX component

Posted 02 September 2010 - 07:23 AM

parbipindid you read my link there is a point running the remote application

just read this section

Creating an Object on a Remote Computer
Was This Post Helpful? 0
  • +
  • -

#7 parbipin  Icon User is offline

  • D.I.C Head

Reputation: 29
  • View blog
  • Posts: 95
  • Joined: 23-August 10

Re: Cannot create ActiveX component

Posted 02 September 2010 - 09:46 AM

@thava: My bad. I perhaps misunderstood george's requirement. I assumed He is looking to create a local object from a remote application. If the database resides on the remote machine, I think he would need what you suggested.

Thanks
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1