File access in different locations

Results 1 to 2 of 2

Thread: File access in different locations

  1. #1
    DF Guest

    Default File access in different locations

    I&#039;m currently working on a project where I do the work at home, then load the pages onto a server. Only thing is all the lines of code for loading text files have to be changed i.e. Set MyTextFile=MyFileObject.OpenTextFile("c:asp_projec tfile.txt", 1) &#039;All one line<BR>has to be changed to<BR>Set MyTextFile=MyFileObject.OpenTextFile("e:cm4dpffile .txt, 1) <BR>is there any way of just entering file.txt as the file will always be in the same directory as the asp page calling it.<BR><BR>Thanks in advance

  2. #2
    Join Date
    Dec 1969

    Default RE: File access in different locations

    Can&#039;t u put the directory into a variable:<BR><BR>strDirectory = "c:asp_project\"<BR><BR>Then use that variable in your code (u would only have to change it once then:<BR><BR>MyTextFile=MyFileObject.OpenTextFile( strDirectory & "file.txt", 1)<BR><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