[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2004-10-27
39
Medium Priority
?
13,989 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
Comment
Question by:mb_howard
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 15
  • 11
  • 7
  • +4
39 Comments
 
LVL 48

Expert Comment

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

Expert Comment

by:Mikal613
ID: 12424634
also you would need the Access Libray

Which would be something like

MSACC9.OLB
0
 

Author Comment

by:mb_howard
ID: 12424657
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 32

Expert Comment

by:Erick37
ID: 12424684
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
ID: 12424703
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
ID: 12424738
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
ID: 12424759
0
 

Author Comment

by:mb_howard
ID: 12424867
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
ID: 12424896
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
ID: 12424918
the user has to have permission to run access
0
 

Author Comment

by:mb_howard
ID: 12424940
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
ID: 12425046
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
ID: 12425102
mmmm
0
 
LVL 4

Expert Comment

by:AjithJose
ID: 12425188
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
ID: 12425193
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
ID: 12425222
Do YOU HAVE security to do so?
0
 

Author Comment

by:mb_howard
ID: 12425231
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
ID: 12425270
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
ID: 12425293
0
 
LVL 48

Expert Comment

by:Mikal613
ID: 12425325
0
 
LVL 4

Expert Comment

by:AjithJose
ID: 12425582

The ultimate solution: Remove and Reinstall MS-Office.


0
 
LVL 4

Expert Comment

by:AjithJose
ID: 12425628
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
ID: 12425751
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
ID: 12425791
what version of iis do you running?
Do you enable AspAllowOutOfProcComponents?
0
 
LVL 48

Expert Comment

by:Mikal613
ID: 12425815
how about the MDAC and jet ?
0
 

Author Comment

by:mb_howard
ID: 12425926
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
ID: 12425940
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
ID: 12425964
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
ID: 12425998
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
ID: 12426027
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
ID: 12426132
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
ID: 12426191
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
ID: 12426245
BTW: What about Office Applications, are they working properly?
0
 

Author Comment

by:mb_howard
ID: 12426519
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
ID: 12426871
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
ID: 12464637
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:
modulo earned 0 total points
ID: 12898576
PAQed with no points refunded (of 500)

modulo
Community Support Moderator
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.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

656 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