Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Access to Directory, Drive`

Posted on 2001-06-07
15
Medium Priority
?
177 Views
Last Modified: 2010-05-02
I am using the Drive control and the Directory control to allow users to search for files.  My problem is I don't know how to check to see if the user has the proper permissions on a particular drive or directory.  Windows Explorer allows to you to map a network drive even if you do not have access to it.  This drive or directory shows up in the drive or the directory control. I would like to have code that, when a user selects a particular drive, I can check for permissions before setting the directory control with this line: Dir1.Path = Drive1.Drive.  I know that I am able to accomplish this by using error checking, but I would like to check for permissions before an error occurs.  Thanks.
0
Comment
Question by:NeedAnswer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 3
  • +1
15 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6163558
Actually, i recommend that you stay with the error checking, as you need the error checking anyway (the network drive might be inaccessible for other reasons).
At least you should have error checking...

Cheers
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6163682
i'm stay with angelIII.
Cheers
0
 

Author Comment

by:NeedAnswer
ID: 6519934
I am deleting the question since I have not gotten the answer I am looking for and the question appears to have been forgotten.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:NeedAnswer
ID: 6519958
I am deleting the question since I have not gotten the answer I am looking for and the question appears
to have been forgotten. Thanks.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6520428
But you never post any comment regarding angelIII's comment!
0
 

Author Comment

by:NeedAnswer
ID: 6522810
I apologize.  angelll's answer is not what I am looking for.  I already know that i can handle it through error checking.  I am looking for a more proactive approach to it.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6525306
Well, maybe windows allows you to map a drive but, for sure, if you haven't permissions ,at least, to read them, you couldn't explore it.
I think this isn't a matter of drive, file, folder controls.
Where are located those drives?, is a network, who is the controller?, it's a novell, linux, unix, nt network?
The machine where are shared resources is who denny/allow you to access folders, drivers even files.
More data could help.
0
 

Author Comment

by:NeedAnswer
ID: 6619114
It is an standard NT machine.  I am simply trying to determine if I have access to a drive without trying to access it and then see if I receive a permissions error.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6619161
in that case, you might look around the GetFileSecurity API to find this information, for example:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvbpj99/html/lj1099.asp

CHeers
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 900 total points
ID: 6619261
or see this question, TimCottee has given an interesting comment:
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20226840
0
 
LVL 4

Expert Comment

by:P1
ID: 6625448
Look up the syntax to 'Dir'.

You can manipulate this command to determine the present of your directory and / or Path/Filename.

The successful detection of presence should get you enough information to proceed with your code.

If you need help with coding, provide a code snippet.

Enjoy your work,  P1
0
 
LVL 4

Expert Comment

by:P1
ID: 6625454
PS:

I like it because it works also with UNC's and it not dependent on user mappings.

Regards, P1
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6625887
"It is an standard NT machine.  I am simply trying to determine if I have access to a drive without trying
to access it and then see if I receive a permissions error."
I think the problem is that you will not receive permission error since dir controls simply doesn't shows the contents of directory if you have no access rights and what shows file control is the last dir contents of previous one with access rights.
P1 is not a bad idea but Dir control never raise a Change event if you have no access to the contents of folder, so, where store that "validation" before actually proceed with listing of contents?
0
 
LVL 4

Expert Comment

by:P1
ID: 6625965
Use Dir itself to fill an image list.  Then you have those items only you have access to.

Regards,  P1
0
 

Author Comment

by:NeedAnswer
ID: 6630255
I found this to be the most helpful.  Thanks everyone.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question