I have trying to write an text file at brinkster.com and other host
sites like it. every time I write a text file I recieve a syntax error of
sought. I know that my code is correct but I thinks for some reason a text
will not appear. Does anyone have any idea why?
<html><body>
<h1> write to a file: this is not a working code. For some rease write file
does not work</h1>
<%
'our constant
Const ForWriting = 2
'declare our variables
Dim objFSO , objTextStream , file
'path to our file
file = Server.MapPath("samplefile.txt")
'create an instance of file object
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
'open the text file
Set objTextStream = objFSO.OpenTextFile(file , ForWriting , True)
'write a line of text
objTextStream.WriteLine "We are writing a line of text to our text file"
'and another
objTextStream.Write "This is our second line of text" & VBCrLf
'display a message to confirm message written
Response.Write "we have written to our text file"
'close textstream
objTextStream.Close
'destroy objects
Set objTextStream = Nothing
Set objFSO = Nothing
%>
</body></html>
In order to narrow down the possible problem I ran the code line by and it
work alway up to the line Set objFSO =
Server.CreateObject("Scripting.FileSystemObject"). I'm not sure what could be
the problem other than brinkster doesn't have the ablity to run
server.createobject. Is there reason why server.createobject wouldn't run. if
it is brinkster's problem, explain why, If you can. is the ablity to write a
text file a big deal?
---------------------------------
Yahoo! Personals
Single? There's someone we'd like you to meet.
Lots of someones, actually. Yahoo! Personals
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor --------------------~-->
1.2 million kids a year are victims of human trafficking. Stop slavery.
http://us.click.yahoo.com/.QUssC/izNLAA/TtwFAA/saFolB/TM
--------------------------------------------------------------------~->
ASP Resources www.asp-dev.com
============================================================
Learn over lunch. Get the developerWorks newsletter and
enjoy tools, code, and tutorials, along with your sandwich.
XML, Linux, Web services, Java -- and peanut butter!
http://www.topica.com/partner/AP-1RMZ49/partners/ibm/aff_landing.html
============================================================
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/asp/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/