Solved

How do I fix "Activex  component cant' create object" error

Posted on 2008-09-29
5
276 Views
Last Modified: 2012-08-13
the following snippet giives the error "Activex component can't create object".

<SCRIPT LANGUAGE="VBSCRIPT" runat="server">
on error resume next
dim fso
set fso = CreateObject("Scripting.FileSystemObject")
msgbox "fso error - " & err.description

All I am trying to do is read a text file on the server and format the text data in a table on a web page.
I am coming from windows apps and script background and don't know why this script won't work in a html file.


0
Comment
Question by:utahalee
  • 3
  • 2
5 Comments
 
LVL 10

Expert Comment

by:Bane83
ID: 22607224
Hi there,

Just testing your little snippet, I get a parser error on the like runat="server" for your script.

This, however, worked:

[code]<script language="vbscript" type="text/vbscript">
on error resume next
dim fso
set fso = CreateObject("Scripting.FileSystemObject")
msgbox "fso error - " & err.description
</script><script language="vbscript" type="text/vbscript">
on error resume next
dim fso
set fso = CreateObject("Scripting.FileSystemObject")
msgbox "fso error - " & err.description
</script>[/code]

Hope that solves it for you.
0
 
LVL 10

Expert Comment

by:Bane83
ID: 22607276
Ok well the above script is supposed to only read:

<script language="vbscript" type="text/vbscript">
on error resume next
dim fso
set fso = CreateObject("Scripting.FileSystemObject")
msgbox "fso error - " & err.description
</script>

Sorry about that.
0
 

Author Comment

by:utahalee
ID: 22614446
I added your change but I still get the same error.  
Someone told me to change CreateObject to Server.CreateObject.  I now did the error "Object Required".
The script in a .vbs file by itself works on the server but I get  theerrors when I add the script to an html file on the same server.

I get the same error "Activex component can't create object" in Javascript  script with the line:
var fso = new ActiveXObject("Scripting.FileSystemObject")

Any other suggestions why I can't use the FileSystemObject in script?

Thanks
0
 
LVL 10

Accepted Solution

by:
Bane83 earned 50 total points
ID: 22625288
Hi there.

Based on the code working for me, but not for yourself, it leads me to believe there is something amiss with your system. A buddy pointed me towards this article, which may be helpful to you!

http://softimage.wiki.avid.com/index.php/ERROR_:_ActiveX_component_can%27t_create_object:_%27Scripting.FileSystemObject%27

Hope that solves it.
0
 

Author Closing Comment

by:utahalee
ID: 31501174
Thanks for your help.  I was afraid the problem was going to be something in the system.  I guess we'll start looking that direction.
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

In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

808 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