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?
Printable View
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?
What determines whether or not access is denied for a given folder?
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.
Answer from TechiQuote:
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?
Private Sub Drive1_Change()
On Error GoTo ErrorHandler
Dir1.Path = Drive1.Drive
Exit Sub
ErrorHandler:
MsgBox ("No disk available to read from!")
End Sub
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?
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.