OK - I give up

Results 1 to 3 of 3

Thread: OK - I give up

  1. #1
    Weston Guest

    Default OK - I give up

    I have been trying to solve this little problem for a few weeks and have decided I need some professional help. I think what I am trying to do is simple but I am apparently too thick headed to understand why it won&#039t work. I am trying to create a form that will take the entered data and store it into a text file on the server. I have studied many examples and do not seem to be able to get any method to create the text file. The current slice of code to try this is as follows:<BR> if objFS.FileExists("dirlist.txt") then<BR> set objFile=objFS.OpenTextFile("dirlist.txt",ForAppend ing, False)<BR> else<BR> set objFile=objFS.CreateTextFile("dirlist.txt,true)<BR > end if<BR>I have tried putting in "_private/" in front of the file name, using the path "http://domainname/dirlist.txt" and other forms of these. Everything I try give me one of the following:<BR> 1: returns error "Microsoft VBScript runtime error &#039 800a004c&#039<BR> Path Not Found"<BR> or 2: Appears to work correctly, but the file is never created.<BR>If someone besides me is playing with this on This Thanksgiving Day, I will give thanks if they can help me. <BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: OK - I give up

    try this <BR>Sub WriteKeyToFile(MyString,strFileName)<BR> Dim keyFile, fso<BR> set fso = Server.CreateObject("scripting.FileSystemObject") <BR> set keyFile = fso.CreateTextFile(strFileName, true) <BR> keyFile.WriteLine(MyString)<BR> keyFile.Close<BR>End Sub<BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: OK - I give up

    or just try using c:inetpubwwwrootyourfile.txt instead of the http://-notation; you could take use of the server.mappath to find the correct real position.<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