ASP help.

Discussion in 'OT Technology' started by Squally, Sep 18, 2004.

  1. Squally

    Squally New Member

    Joined:
    Sep 24, 2002
    Messages:
    7,293
    Likes Received:
    0
    Location:
    West LA
    Ok, i've made a counter app that runs off of a php script that writes to a text file. Now I need to make the same thing in asp. My question that I can't seem to find the answer to is can you lock a file for writing in ASP? I don't want to get an error when two people try to access the text file at the same time to write to it.
     
  2. Juggernaut

    Juggernaut Guest

    we need more details and I can help :hs:
     
  3. Keyzs

    Keyzs OT Supporter

    Joined:
    Nov 3, 2003
    Messages:
    814
    Likes Received:
    0
    Location:
    Charlotte, MI
    I second Juggernaut, we need more info.

    But there isnt really a 'locking' mechanism in ASP. You can open the file ForWriting or ForAppending and it will lock the file.

    If that is not enough control for your purposes you really need to find a better method than a text file to do what you need.

    FYI:
    FileSystemObject.OpenTextFile(filename,[mode],[create],[format])

    Mode: [optional]
    1=ForReading - Open a file for reading. You cannot write to this file.
    2=ForWriting - Open a file for writing.
    8=ForAppending - Open a file and write to the end of the file.
     

Share This Page