Can I read data from a text file using vbscript in a html file?
Posted on 2008-09-30
I have done a lot of windows apps programs and vbscript files, but not web apps, hence my confusion. Can I read a text file using the filesystemobject in a vbscript in an html file? I just need to read some data from the text file. I don't want to use a database and a table if I can read the data in a text file.
the html file runs fine on my pc but I get the error when I move the html to the server and try to run it in a browser on my pc.
Here is my html
<SCRIPT LANGUAGE="VBSCRIPT" runat="server">
on error resume next
set fso = CreateObject("Scripting.FileSystemObject") '''error occurs here
msgbox "fso error - " & err.description
the msbox displays "fso error - Activex component can't create object".
I can move the script to a.vbs file and run in on the server without the error. It can create the filesystemobject in a vbs script file on the server, but the script in the html file gets an error trying to create the filesystemobject on the server.
This seems like a simple thing to do but I'm just getting started with web apps and not sure what works or doesn't. Can I do what I want???