Results 1 to 6 of 6

Thread: DirListBox

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2000
    Posts
    45
    Hi,
    I'm using a dirlistbox to list all directories.
    How can I display a message to the user if the access is denied for the selected directory?




  2. #2
    Frenzied Member mlewis's Avatar
    Join Date
    Sep 2000
    Posts
    1,226
    What determines whether or not access is denied for a given folder?
    M. Lewis
    Pi-Q Software
    How many mouse clicks does it take to cook breakfast?

    Blargh! I am dead!

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2000
    Posts
    45
    there is some kind of security where an accessgroup is assign to the directory and the accessgroup consist of a set of people that has access to the directory.

  4. #4
    Guest

    dirlistbox

    Originally posted by jess
    Hi,
    I'm using a dirlistbox to list all directories.
    How can I display a message to the user if the access is denied for the selected directory?

    Answer from Techi

    Private Sub Drive1_Change()
    On Error GoTo ErrorHandler
    Dir1.Path = Drive1.Drive
    Exit Sub
    ErrorHandler:
    MsgBox ("No disk available to read from!")
    End Sub

  5. #5

    Thread Starter
    Member
    Join Date
    Jun 2000
    Posts
    45
    The event Dir1_Change is not even triggered if I'm selecting a directory that I'm not having access right to. It is strange because it looks just like the directory is selected since all other directories on the same level disapear but the Change event is not fired. What is really going on?

  6. #6
    Frenzied Member mlewis's Avatar
    Join Date
    Sep 2000
    Posts
    1,226
    If your on a NT network, chances are that the DirListBox is coded to prevent people from accessing unauthorized resources. The only way to do this I think is to subclass the box and wait for clicks; if a click is over an item but no Change event fires, then you know that its an unauthorized folder, and you inform the user of that fact.

    Other than that, all I can think of is to just tell users somehow (READMEs etc) that the behavior is intended and not work-around-able.

    M. Lewis
    Pi-Q Software
    How many mouse clicks does it take to cook breakfast?

    Blargh! I am dead!

Posting Permissions

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



Click Here to Expand Forum to Full Width