Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FSO and text files

Status
Not open for further replies.

Remou

Technical User
Sep 30, 2002
13,030
BE
Hi
I am trying to write a text file. I can only find stuff on File System Object which gives me errors.
If I put in:
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
I get
Error: Object Required: 'Server'

If I put in:
Set FSO = CreateObject("Scripting.FileSystemObject")
I get:
Error: ActiveX component can't create object: 'Scripting.FileSystemObject'

Am I making some stupid mistake?
or
Does the server not allow this (It has let me use other asp / vbscript stuff)?
If it is the server, is there any other way to write a text file?
Any help / hints would be much appreciated.
 
it sounds like your server does not support FSO.

are you running this through a server?

____________________________________________________
get the best answer to your questions by asking the best questions "General FAQ" faq333-2924
onpnt2.gif
 
Hello onpnt
Thanks for your response. Perhaps if I explain that I have a small site hosted by a provider with an Access database that is updated occasionally by users of the site. I would like to write out updates to a text file and download it for backup purposes. I need to be able to do this from primitive net cafes. The server on the site lets me use Server.CreateObject("ADODB.Connection") for example.

I visited the site you recommended and got into a loop, not a download - I am clearly missing something.

Thanks again
PS all this is on a ****up as I go along basis.
 
Try uploading a file with this small script on it. It should tell you which version of IIS your provider is running:
Code:
<%
Response.Write Request.ServerVariables(&quot;SERVER_SOFTWARE&quot;)
%>

This may give us a hint as to what your server should be able/should not be able to support.

-Tarwn

01010100 01101001 01100101 01110010 01101110 01101111 01101011 00101110 01100011 01101111 01101101
29 3K 10 3D 3L 3J 3K 10 32 35 10 3E 39 33 35 10 3K 3F 10 38 31 3M 35 10 36 3I 35 35 10 3K 39 3D 35 10 1Q 19
Do you know how hot your home computer is? I do:
 
Hello Tarwn
It says:
Microsoft-IIS/4.0
Your note gave me the clue, I had <script>, sorry about that.

I have a new problem now:
<%
Set FSO=Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set TextStream = FSO.CreateTextFile(&quot;FSOtest.txt&quot;)
TextStream.WriteLine(&quot;Line of text&quot;)
TextStream.Close
%>
This runs without errors, but I don't end up with a text file.
Thanks again, everyone.
 
upgrade to 5.0

____________________________________________________
The most important part of your thread is the subject line.
Make it clear and about the topic so we can find it later for reference. Please!! faq333-2924

onpnt2.gif
 
also verify the version of scrrun.dll in your system folder, this file is overwritten alot by applications and is what drives FSO if it's been overwritten then all FSO will fail regardless of IIS version
 
Hello and thanks for the help.

Thanks to your hints, I finally started thinking (!)

<%
dirdat=Server.MapPath(&quot;\&quot;)
fildat=dirdat & &quot;\FSOtest.txt&quot;
Set FSO=Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set TextStream = FSO.CreateTextFile(fildat)
TextStream.WriteLine(&quot;Line of text&quot;)
TextStream.Close
%>
works fine, and I end up with a text file. Now for stage 2.
Byeeee :eek:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top