-
Mar 15th, 2017, 11:17 AM
#1
Thread Starter
Lively Member
[RESOLVED] Access Right Issue - Writing a file
Using VB6 on Win 7 Pro.
We gave access rights to a user for only 1 directory inside of the Z: network drive, that directory is Z:\A\
When the user executes :
(fn is Z:\A\test.txt, s is a string)
Open fn For Output As 117
Print #117, s
Close #117
The system does not allow him to write/open a file on that directory and it throws an exception. A different user who has access rights to the whole of the Z: network drive, is able to write a file to that directory with no problem.
Is there something specific that needs to be set up in the VB6 program ? Or do other sub directories on the Z: drive need to allow access rights as well such as z:\temp\ perhaps ?
Any ideas ?
Thanks,
Mips.
-
Mar 15th, 2017, 11:30 AM
#2
Re: Access Right Issue - Writing a file
Has nothing to do with VB, it is an access right problem.
If the user open Notepad, writes some text and tries to save in Z:\A\ then the same error will occur.
-
Mar 15th, 2017, 11:32 AM
#3
Thread Starter
Lively Member
Re: Access Right Issue - Writing a file
The user can actually write a notepad file to that directory manually. However, when it gets executed from within VB6, it throws an exception.
Any thoughts ?
Thanks,
Mips
-
Mar 15th, 2017, 11:32 AM
#4
Re: Access Right Issue - Writing a file
Then give the exact error and the exact code you used
-
Mar 15th, 2017, 01:10 PM
#5
Thread Starter
Lively Member
Re: Access Right Issue - Writing a file
OK, I found out what was the issue.
So when fn = "Z:\A\test.txt" , that did not work.
But when fn = "\\MYSRV\Zdrive\A\test.txt" , that works. Using Z: as a mapped drive name, did not work in this case.
Thanks,
Mips. :-)
-
Mar 16th, 2017, 01:10 PM
#6
Re: [RESOLVED] Access Right Issue - Writing a file
There is probably something else going on.
For example a lot of people let users run wild using Administrators accounts. Because of the split contexts such users have, a drive mapping might exist in one context and either not exist at all or have a different mapping in the other context.
Very few users should have an Administrators account. Developers often need them, but developers should be well aware of how the dual user-context mechanism works. We've had to deal with this since it came out back in 2006.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|