Solved

ActiveX component can't create object: 'Access.Application'

Posted on 2004-10-27
13,508 Views
Last Modified: 2013-11-25
HELP WITH AN EXTREMELY URGENT PROBLEM! :-)

I have an ".asp" page that uses VBScript to try and create and "Access.Application" object. Here is the ENTIRE code:

<%@ Language=VBScript %>
<SCRIPT LANGUAGE="vbscript">
   Sub test
      MsgBox "Running test..."

      Set appAccess = CreateObject("Access.Application")
            
      appAccess.opencurrentdatabase "C:\Inetpub\wwwroot\BizRulesProject\bizrules.mdb", "administrator", ""
      appAccess.Visible = False
            
      appAccess.DoCmd.OpenModule "BizRuleCode", "testme"
      
      MsgBox "Try to run testme in BizRuleCode...."

      'run the function
      appAccess.DoCmd.RunCode "testme"

      Set appAccess = Nothing
      
      MsgBox "Done!"
      
   End Sub
</SCRIPT>

<HTML>
<body>
<form NAME="frmINV_INVESTMENT_S" METHOD="POST" ID="Form1">
      
      <BUTTON NAME="Submit" OnClick="test()">Save</BUTTON>
</form>
</body>
</HTML>

Mu ultimate goal of this script is to execute the following function (named "TestMe") which resides in a Microsoft Access class module named "BizRuleCode":

Option Compare Database
Option Explicit
' some comments here

Public Function TestMe() As String
    MsgBox "This is a test."
End Function

My script errors out on the line of code: Set appAccess = CreateObject("Access.Application") with the error:

ActiveX component can't create object: 'Access.Application'

I've searched practically every Internet resource I can find, but I haven't been able to get this thing running. I have the IIS server installed on my local computer, which is using the XP Professional operating system. My Access version is 2002. I noticed the following statement on "ASP Emporium" that says the following:

Fix/Workaround:
You are missing required IIS functionality. You must find and install the proper COM object on your server. For example, if you are getting this error with the class string: "scripting.filesystemobject", you do not have the SCRRUN.DLL installed and registered on your server

I am not sure what "the proper COM object" is to install on my server. Is there a DLL file that I am missing that prevents me from creating objects in VBScript? Is there a permission issue, and how do I tell if there is and how would I resolve it? I have tried to register the msado15.dll and dao360.dll files using "regsvr32" but I am still getting the same error.

I am at my wit's end! Can someone......ANYONE.....help me to get this thing working????? I wish I could give this question 1,000,000 points....

Thanks,

Matt

0
Question by:mb_howard
    37 Comments
     
    LVL 48

    Expert Comment

    by:Mikal613
    Do you have Access installed on your computer?
    0
     
    LVL 48

    Expert Comment

    by:Mikal613
    also you would need the Access Libray

    Which would be something like

    MSACC9.OLB
    0
     

    Author Comment

    by:mb_howard
    Yes, Actualy, I have both Access 97 and Access 2002 installed. I was able to identify their ClassIDs in the registry:

    HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Access.Aplication

    There is also an "Access.Application.8" and an "Access.Application.10". When I try to substitute these in the CreateObject command, I still get the same "can't create object" error. :-(
    0
     
    LVL 32

    Expert Comment

    by:Erick37
    This may help:

    INFO: Considerations for Server-Side Automation of Office
    http://support.microsoft.com/default.aspx?scid=kb;en-us;257757

    0
     

    Author Comment

    by:mb_howard
    Mikal613,

    I was able to locate the file "MSACC.olb" in "C:\Program Files\Microsoft Office\Office10" where Access 2002 resides.

    I'm just not sure what to do with this file.
    *****************

    Erick37,

    I will check out the link you posted.

    Thanks to both of you! I will let you know what happens.
    0
     
    LVL 48

    Expert Comment

    by:Mikal613
    checked MS Access registration on server?
    changed security and permission on my server to allow IUSR user to launch/execute Access?
    changed security and permission on my folder to give full control to IUSR user?
    0
     
    LVL 48

    Expert Comment

    by:Mikal613
    0
     

    Author Comment

    by:mb_howard
    Mikal613,

    I believe that MS Access is registered on my server (their Class IDs are listed in the registry).

    In regards to allowing IUSR to launch/execute Access, how do I accomplish this?

    In regards to IUSR control, I do not see this user when I right click my "wwwroot" folder, select "Properties" and view the users in the "Security" tab. Is this the correct way to get to IUSR?
    0
     
    LVL 4

    Expert Comment

    by:AjithJose
    Try invocking the Access.Application object using the OLE Viewer applet which comes with visual studio. If object creation fails then the ole viewer will report more details, which will help you to pinpoint the problem

    Or run your vbscript code using VB or in any VBA  application and check the result.

    You can download ole viewer from:
    http://www.microsoft.com/windows2000/techinfo/reskit/tools/existing/oleview-o.asp


    0
     
    LVL 48

    Expert Comment

    by:Mikal613
    the user has to have permission to run access
    0
     

    Author Comment

    by:mb_howard
    AjithJose,

    I instaled OLE Viewer, but I can't make too much sense of all the object classes in order to know what to look for.....The "Automation Objects" class looked promising, but I'm not sure what to do with the info that is being provided.
    0
     

    Author Comment

    by:mb_howard
    Mikal613 ,

    I found the user"Internet Guest Acount" and added it to both the "wwwroot" properties window (Security tab) as well as the Access database properties (Security tab). I gave "Read & Execute" permission (as well as "List Folder Contents" and "Read") to this user.

    I went back to test my script and I am atill getting the same error. Am I setting the user permissions correctly, or is there another way to do this?

    Thanks again for your time and patience. :-)
    0
     
    LVL 48

    Expert Comment

    by:Mikal613
    mmmm
    0
     
    LVL 4

    Expert Comment

    by:AjithJose
    Open OLE Viewer,

    Expand   'All Objects'

     find the key 'Microsoft.Access.Application'

    right click and select 'Create Instance' from context menu. If object creation failed, you will get error messages. Else the key will expand. You can set object privileges on right pane

    0
     

    Author Comment

    by:mb_howard
    Just as a comment, I get the same error when trying to createother Office-related objects (Excel.Application, Word.Application)
    0
     
    LVL 48

    Expert Comment

    by:Mikal613
    Do YOU HAVE security to do so?
    0
     

    Author Comment

    by:mb_howard
    AjithJose,

    When I right click on 'Microsoft.Access.Application', the "Create Instance" option is greyed out. I can only select the "Release Instance" options and below.
    0
     

    Author Comment

    by:mb_howard
    Mikal613 ,

    If you are referring to my login account (the username and password I used to log into my computer), the answer is definitely YES. :-)

    Perhaps if I log in as the administrator of this computer? I'll check....
    0
     
    LVL 48

    Expert Comment

    by:Mikal613
    0
     
    LVL 48

    Expert Comment

    by:Mikal613
    0
     
    LVL 4

    Expert Comment

    by:AjithJose

    The ultimate solution: Remove and Reinstall MS-Office.


    0
     
    LVL 4

    Expert Comment

    by:AjithJose
    The ultimate solution: Remove and Reinstall MS-Office.

    Because:

    "I get the same error when trying to createother Office-related objects (Excel.Application, Word.Application"

    Strongly suggests that your office installation and registeration went corrupted somehow. Reinstalling is the easiest and fastest method than repair


    0
     

    Author Comment

    by:mb_howard
    Mikal613,

    In the article that you last posted, I noticed the following text:

    **************
    DLLs Missing From the System
    The DLL that implements the COM object must exist on the system and be registered with the correct path. Creation failure of a COM object that is not registered at all will actually generate a different error:

    Server object error 'ASP 0177 : 800401f3'

    To verify that the path in the registry is correct, run the RegEdit program and search for the PROGID (found in the CreateObject call). From the PROGID entry, record or copy the CLSID to the Clipboard and locate the entry for the CLSID. This entry should contain an InprocServer32 key with a path to the DLL
    **************

    I found the ClassID of 'Access.Application' and it did not have an "InprocServer32" key with any DLL paths. I noticed a "InprocHandler32" key pointing to "ole32.dl" and a "LocalServer32" key pointing to MSACCESS.EXE.

    I don't know if the fact that the "InprocServer" key not being listed under the ClassID is of any relevance to the error I'm getting. The article doesn't expalin this. I don't even know what DLL I am looking for!    :-(

    *************

    AjithJose,

    Unfortunately, I can't do a re-install of Office on my work computer. I am getting the same errors when trying to run the same ASP page on my home computer. I will check the registry and do a re-install there to see if the problem goes away.

    Thanks! :-)
    0
     
    LVL 26

    Expert Comment

    by:EDDYKT
    what version of iis do you running?
    Do you enable AspAllowOutOfProcComponents?
    0
     
    LVL 48

    Expert Comment

    by:Mikal613
    how about the MDAC and jet ?
    0
     

    Author Comment

    by:mb_howard
    Erick37,

    I checked out the link you referred me to and it was very helpful. Here's the conundrum that I find myself in:

    I have a 'business rules engine' application that was written ENTIRELY in Access. Database, VB code, class modules, forms, THE WORKS. The rules engine actually generates VB code which is dynamically based on business rules that you define using Access forms from a custom toolbar. Database tables are set up that collect metadata to form a 'rules repository' that is used in dynamic code generation. The database also contains the 'Application database', which is the

    In total, there are about 50+ forms and a great deal of code under the hood. About 20% of these are the forms that make up the user application. The other 80% of the forms are data entry screens for the rules repository itself.

    The Access forms that comprise the user application run the dynamically-generated functions to validate the data entered by the user (required fields, other business logic, etc). What I want to do is to create these data entry forms on the web using ASP/VBScript and have them call the same functions that the Access form was calling. That is where I get into the whole "Automation using Office" thing.

    I thought about trying to CONVERT the Access application to VB.NET. I even went so far as to purchase a utility that claims to accomplish this. Unfortunately, my knowledge of VB.NET is very limited and I am finding out the hard way that it's a VERY different language and architecture than the VB that is used in Access. I can't even populate a combo box with database data! :-(

    I had a couple of questions related to VB.Net and Automation:

    1. Is VB.NET better equipped to handle Automation than Microsoft Access?
    2. Are the class modules in VB.NET more reliably accessible from ASP pages?
    3. Would the use of an ASP.NET user application be better equipped to interract with a repository application written in VB.NET?
    4. Is there anyone out there willing to help in a possible conversion? What would be the price tag?

    The only caveat to all of this is the fact that I am trying to implement this project as a semester-long class assignment, so I need to come up with SOMETHING by the end of this year. I don't know if there is time to convert this massive Access application to VB.net, design the user application in ASP.NET, and get them to talk to each other in time. If not, then I am stuck with trying to use Automation with the existing Access application....

    Any ideas?

    Thanks! :-)

    0
     

    Author Comment

    by:mb_howard
    Mikal613,

    I installed (re-installed?) MDAC and JET and I am still getting the error. I even restarted my computer to be sure....
    0
     

    Author Comment

    by:mb_howard
    EDDYKT,

    I have IIS version 5.1. How would you enable "AspAllowOutOfProcComponents"? I will search for it, but if you know, please let me know. :-)
    0
     

    Author Comment

    by:mb_howard
    Erick73,

    I can't edit my coment to you, but the last sentence of the second paragraph is supposed to read:

    "Database tables are set up that collect metadata to form a 'rules repository' that is used in dynamic code generation. The database also contains the 'Application database', which is the database that the user application interracts with"

    Sorry 'bout that! I am typing faster than I am thinking.....
    0
     

    Author Comment

    by:mb_howard
    EDDYKT,

    Here's what I found:

    ****************
    AspAllowOutOfProcComponents
    In IIS 4.0, this property specifies whether an ASP script is allowed to call out-of-process components, which are executables that are launched from within an application. This property was made obsolete in IIS 5.0 and its value is ignored; however, scripts using this property will continue to function normally.
    ****************
    0
     
    LVL 4

    Expert Comment

    by:AjithJose
    First of all you have to find out which is the problem child: ASP or Access.

    If you have vb installed, then try this test

    Sub Test()
        Dim obj As Object
       
        Set obj = CreateObject("Access.Application")
     
     
        obj.Quit
       
    End Sub

    You can try this even from word or excel VBA


    0
     
    LVL 48

    Expert Comment

    by:Mikal613
    Download the Microsoft Office 2000/Windows 2000 Registry Repair Utility. The Microsoft Office 2000/Windows 2000 Registry Repair Utility restores the registry settings for several important files that prevent potential issues.

    The following file is available for download from the Microsoft Download Center. Click the file name below to download the file:
    o9regfix.exe

    http://support.microsoft.com/kb/q260885/

    The link is on thie page
    0
     
    LVL 4

    Expert Comment

    by:AjithJose
    BTW: What about Office Applications, are they working properly?
    0
     

    Author Comment

    by:mb_howard
    AjithJose,

    Al of my Office applications are working properly (I can open them up and do things with them). I'll try your code example above.

    Also, I was just talking to a friend of mine and he tried to explan to me the difference between CLIENT SIDE and SERVER SIDE scripting. Is the code I displayed at the top of this message (waaaay up there) an example of CLIENT or SERVER side scripting? How would I use server side scripting to create the Access.Application object and call the Access 2000 module functions?

    Ugh... It's time for lunch..... :-)
    0
     
    LVL 4

    Expert Comment

    by:AjithJose
    I think I found some valuable information

    Check out this urls:

    Considerations for Server-Side Automation of Office: http://support.microsoft.com/kb/257757

    CreateObject in VBScript
    http://support.microsoft.com/kb/q183284/

    http://raqxtr.sstar.com/caspdoc/html/vbscript_createobject_function.htm


    The page Considerations for Server-Side Automation of Office  says that:

    "CreateObject/CoCreateInstance returns one of the following run-time error messages and cannot be started for Automation: In Microsoft Visual Basic (VB) or ASP:
    Run-time error '429': ActiveX component cannot create object

    These errors appear because the server-side code is running without a user profile or the user identity that is specified for the launching context does not have proper DCOM permissions. "





    0
     

    Expert Comment

    by:FCCIII
    Hello

    I ran into the exact same error message when attempting to deploy some VB apps that were tied to an Access database. Reinstalling MDAC did not help either. After much fighting I found that if I reregistered the following files, it would work.
    A couple of these files will not register, and thus simply need to be placed in system32.

    dao350.dll
    dao360.dll
    msjet35.dll
    msjint35.dll
    MSJTER35.DLL
    MSRD2X35.DLL
    MSREPL35.DLL
    VB5DB.DLL
    vbajet32.dll

    Hope this helps.
    Rick
    0
     

    Accepted Solution

    by:
    PAQed with no points refunded (of 500)

    modulo
    Community Support Moderator
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
    I made this because I wanted to get e-mail with a attached csv file so I'd would be able to import user input into a MS Excel template, but I also wanted to register/save all inputs from each day in a file on the server. 1st - It creates a temp C…
    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…
    The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…

    856 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

    19 Experts available now in Live!

    Get 1:1 Help Now