path error

Results 1 to 3 of 3

Thread: path error

  1. #1
    nico vermuelen Guest

    Default path error

    Hello<BR><BR>I am getting an error when trying to write to a text file located in my database directory. <BR>The code to write to the file is thus:<BR><BR>Information is put into Dim htmlvar by concatenating values from "post" method form previous and joined together to make HTML line into "htmlvar"<BR><BR>sub storeOptionSelectUK<BR> Dim fs, f<BR> Set fs = CreateObject("Scripting.FileSystemObject")<BR> Set f = fs.OpenTextFile("/db/stsdb/selectUK.txt",8)<BR> f.Write htmlvar<BR> f.Close<BR> fs=nothing<BR>End Sub<BR><BR>It tells me this: <BR>Microsoft VBScript runtime error &#039 800a004c&#039 <BR>Path not found<BR>savetext.asp Line 22<BR>Line 22 is "Set f = fs.OpenTextFile("/db/stsdb/selectUK.txt",8)" but this path I have used in the same directory in another file which works fine. I have been trying for the last hour trying to figure out what is going wrong but either I am blind or have done something wrong that I am unaware of.<BR><BR><BR>Many Thx for your precious time<BR>Nico

  2. #2
    Join Date
    Dec 1969

    Default RE: path error

    You need to use a physical path, not a virtual path.<BR><BR>Set f = fs.OpenTextFile(Server.MapPath("/db/stsdb/selectUK.txt"),8)<BR><BR>Dunc<BR>

  3. #3
    Nico Guest

    Default RE: path error

    Hmmm unless I missed it in the article I was working on from ASP101 they didn&#039t say in this article to use Server.MapPath<BR><BR>No worries it now works and I can continue. Many Thx

Posting Permissions

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