ASP ReadLine is not working on NT

Results 1 to 2 of 2

Thread: ASP ReadLine is not working on NT

  1. #1
    Join Date
    Dec 1969
    Posts
    108

    Default ASP ReadLine is not working on NT

    Hi, I have used one of your great tutorials on how to read a text file with ASP. I followed the procedures mentioned and it works great on my win95 machine. What it does is it reads a text file which I put in the same directory as my /Scripts and it reads the text files and after doing some text manipulations it stores the data into my access database. Now, when I trasfer my files onto the NT server, it does not work.<BR>--&#062; The TextStreamTest &#060;-- is always empty! As if it is not reading the text file. The "mytext.txt" has RW permissions for everyone. P.S. My NT server work with IIS3, it works perfectly on my system (win95) running IIS4.<BR><BR>1- Could the problem be with the IIS version?<BR>2- How do I specify another path for my text file? (example, in my wwwroot directory? <BR>set f = fso.GetFile("//wwwroot/mytext.txt") ???<BR><BR>Here is a portion of my script:<BR>======================================= ==================<BR>Const ForReading = 1, ForWriting = 2, ForAppending = 8 <BR>set fso = Server.CreateObject("scripting.FileSystemObject")< BR>set f = fso.GetFile("c:Inetpubscriptsmyfilemytext.txt")<BR >set ts = f.OpenAsTextStream(ForReading, -2)<BR>TextStreamTest = ts.ReadLine<BR><BR>&#039---- SUPPRIMER LES RECORDS EXISTANT ------<BR>set RSupprimer = Conn.Execute("DELETE * FROM tbl_logs")<BR>&#039------------------------------------------<BR>Do While not ts.AtEndOfStream<BR> TextStreamTest = ts.ReadLine<BR>...<BR>============================ =============================<BR><BR>Any response would be greatly appreciated. Thank you.

  2. #2
    B. Agil Guest

    Default RE: ASP ReadLine is not working on NT

    Hi there!<BR>I don&#039t think it&#039s got to do with your IIS version. However, try using mappath instead of getfile. E.G.:<BR><BR>set filepath = Server.MapPath("/myfile") + "\mytext.txt";<BR>fileobj = Server.CreateObject ("Scripting.FileSystemObject");<BR>set instream = fileobj.OpenTextFile (filepath, 1, false, false);<BR><BR><BR>Hope this helps..<BR><BR>B. Agil<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •