|
-
Sep 11th, 2010, 05:40 PM
#1
Thread Starter
New Member
Permissions using Windows Small Business Server
I have written a simple program in VB6 to allow staff to log their working hours at remote sites but am getting problems with access permissions on the server. The program runs on the remote sites (XP SP3) under a normal user logon. When the user has set their hours of work the program is designed to open a csv file on the server for append to add their work which can then be analysed with Excel. The server runs Windows Small Business Server 2003. I have set up a shared directory on the server with full access permissions for 'everyone' and also the specific user the staff log on as. When the program tries to append the data I get an error 70 -Permission denied. The program can create the file on the server if it does not exist but cannot write to it. If I log on as an administrator on the client the program works fine and can write to the server file. If I am logged on as an ordianry user I can access the server directory using Windows explorer and can delete the file. If I open the file with notepad I can write to it. I cannot see where I have gone wrong! Any advice would be appreciated.
-
Sep 11th, 2010, 10:03 PM
#2
Re: Permissions using Windows Small Business Server
It looks like the normal users don't have proper system rights to be able to modify the file! I'm not sure but I think you might need to change the user settings on the server so the normal users can write to the file.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Sep 12th, 2010, 01:44 AM
#3
Re: Permissions using Windows Small Business Server
'Permission Denied' can also get raised if the file is already open when you attempt to write to it. However, if you can access it fully when running as Administrator that doesn't explain it very well !
Do I understand that, when running as a 'normal' user, the program will create the file but then fail to write to it? To me, that would indicate a permissions issue. I'm not to well versed with XP security but I'm not sure that 'Everyone' actually includes network users. You may have to add Full Control to 'Guest' or 'Anonymous Logon' (or something else, perhaps?)
EDIT: Of course, you could always 'cheat'; find a folder on the server that is fully accessible to 'normal' users and check the Security setting then replicate the appropriate one(s) for the folder in question.
On the subject of 'sharing', is there just the one file for everyone to append to or is there one per person ?
If the former, you will run the risk of access problems if / when two people attempt to append simultaneously. (eg someone starts the program, then pops off for a couple of hours, leaving the file open thus stopping anyone else from being able to update it.) You may have to do some fancy coding to check the file's status before attempting to open it and also make sure the file is opened for the minimal amount of time (eg Check status / Open immediately before the Write, then Close it immediately after the Write)
Last edited by Doogle; Sep 12th, 2010 at 03:15 AM.
-
Sep 12th, 2010, 04:36 AM
#4
Thread Starter
New Member
Re: Permissions using Windows Small Business Server
There is only one file for everyone but the program should open it, write one line of data to it and then close it immediately. The chances of two users trying to write to it simultaneously would be tiny but I accept it could give me the odd crash! We are only talking about four or five users logged on at any time.
I have been trying to test different locations on the server by mapping them as a network drive on the client machines. I have used what is our 'public' directory where users can save their files using Word, Excel etc and the problem still occurs. I have not been able to test every combination of logons etc but on the face of it if I use 'run as' on the client machines and 'run as' administrator the program works as it should - creating, opening and writing to the data file and then closing it.
If I run it as a normal user it creates but will not write. On the security and sharing section of the target folder I have given full control permission to 'everyone' and also the specific logon that the users all use. What really confuses me is if I access the file using notepad or excel, even if logged on as the normal user, I can write to the file. It only seems to be my VB6 program that can't write to it when logged on as a normal user! I only discovered this on Friday when I installed the program so need to do more testing but I have not found anything that helps me regarding permissions in the VB documentation.
I have only currently been able to test it from a compiled version but probably need to try to run it from the development environment so I can see what is happening rather than just get a crash.
-
Sep 12th, 2010, 01:48 PM
#5
Re: Permissions using Windows Small Business Server
Setting file and folder permissions can be a dicey thing.
They seem to consist of a series of acces control entries, each saying "allow this" or "disallow that." Their order in the access control list can have great bearing on the effective permission a user has to perform a given action. Folder permissions can be set to be inherited by contained objects (or not) as well, further complicating the picture.
Note that Write and Modify are two different permissions.
A progam like Notepad never modifies a file, it always replaces the whole file upon Save so that's not a very good test. Maybe try a short WSH script or something instead that opens a text file ForAppending and writes a line to it.
-
Sep 12th, 2010, 02:02 PM
#6
Re: Permissions using Windows Small Business Server
NTFS Permissions, Part 2 (scroll way down) also talks about the interaction between NTFS and Share permissions.
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
|