Solved

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

Posted on 2008-09-29
5
274 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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 …

707 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

20 Experts available now in Live!

Get 1:1 Help Now