Solved

How to check via LotusScript if the current user has access to a specified drive and path ?

Posted on 2008-06-11
2
2,207 Views
Last Modified: 2013-12-18
Hi All,

I need to check with LotusScript if the current user has access to a specified path before contninuing the run of the script.
For example : by checking if he can access this directory "R:\OPS\ABC\Teams\Dev\IDN" and subdirectories.
How can I do that ?
Thanx for any help.
0
Comment
Question by:giggina
2 Comments
 
LVL 13

Accepted Solution

by:
CRAK earned 300 total points
ID: 21763109
You could use Dir to check if the dir is available/accessible to the user.
If the user is supposed to read a file, consequently try that. If he/she needs to write a file, give that a try. If you're unfamiliar with that, check designer help on "Open".
Do all that in a separate function with built-in error trapping (on error goto..). Return e.g. true if all went well, or false when not.
0
 
LVL 7

Assisted Solution

by:olaraak
olaraak earned 200 total points
ID: 21764218
Yes, Run-time errors give plenty of information about failed file operations, for example:

File not found
Bad file mode
File already open
Device I/O error
File already exists
Bad record length
Disk full
Bad file name
Device unavailable
Permission denied
Disk not ready
Cannot rename with different drive
Path/file access error
Path not found
File not writable
File not readable
Illegal file number
File not open
Unable to open file
Illegal operation for file mode

... and others.

You can also set different error handling routes, depending on error code, to take specific actions.


Function DoSomethingWithFile()
 ' Error trapping
 On Error Goto catch
 
   ' ---
   ' File-handling code
   ' ---
 
  Exit Function ' To avoid error message during normal execution
catch:
  Print "Error in Function ""DoSomethingWithFile"": "  & Str(Err) & " " & Error$ & " on row " & Cstr(Erl)
  Exit Function
End Function

Open in new window

0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Why won't this building block macro run? 6 287
Lotus Notes 8.5 1 149
Text over two lines in VBA for email 26 162
CopyAllItems causing problem with permissions 3 93
For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

803 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