1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Permission denied error

Discussion in 'C#' started by inderpal, Aug 14, 2006.

  1. #1
    Hi All,

    I am getting "Microsoft VBScript runtime (0x800A0046) Permission denied" error at
    Code:

    set file = fs.OpenTextFile(fileName, openMethod, true)
    Code (markup):
    I have given permission IUSR_<computername> user to read/modify the directory by adding it to the security tab. I have even given permission to Everyone but still I am getting the same error.

    I would appreciate any help in this regard. Thanks in advance!

    Best Regards,
    Inderpal Singh
     
    inderpal, Aug 14, 2006 IP
  2. danae

    danae Peon

    Messages:
    29
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    What open method are you using?

    The options are ForReading and ForAppending.

    You also might want to verify the file has received the correct IUSR permissions from the directory.

    HTH
    -Danae
     
    danae, Aug 14, 2006 IP
  3. vectorgraphx

    vectorgraphx Guest

    Messages:
    545
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Good advice danae, i'm thinking your second suggestion is probably hitting the nail on the head.

    Inderpal, if you change your permissions on a directory in the security tab, you will also need to click the "advanced" button and choose the option to "allow permissions from this object to propegate to objects within this directory" or some other similarly worded microsoft-ese jargon. Sometimes just changing the permissions of a directory will leave the current file permissions intact on files contained within the folder.

    thats my .02

    Vectorgraphx
     
    vectorgraphx, Aug 14, 2006 IP
  4. inderpal

    inderpal Active Member

    Messages:
    919
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    68
    #4
    Thanks guys for your help but I am still struggling with the problem. I have checked all user permissions are there and I am using ForAppending method to append in the exsiting file and if it's not there it should create it as I am passing true as a parameter.

    Is there anything I can do to make it work?

    Best Regards,
    Inderpal Singh
     
    inderpal, Aug 16, 2006 IP
  5. vectorgraphx

    vectorgraphx Guest

    Messages:
    545
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #5
    if you're still having issues you might post more code - it might be elsewhere in your script. sounds like you've covered all the generic solutions. regarding file/directory permissions.
     
    vectorgraphx, Aug 17, 2006 IP