Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In this tutorial I will aim to show you how simple is making a small application in WhizBase, how to add, remove and update data in the DB. I will make a small address book application where you can add, browse, update and remove addresses. I wi…
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 …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

947 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

23 Experts available now in Live!

Get 1:1 Help Now