473,385 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Creation of Folders on Server

tdw
206 100+
Hi all,

This is an Access question, but it may spill over into requiring non-Access solutions. Please let me know if I should look for this answer elsewhere (and if you have suggestions on where to find it).

My Orders Database creates a folder on our server for each new order we receive (i.e. each new record entered).
It does this as a part of an OnClick Event from a command button.

This folder structure on the server is very important. Each folder contains all of the files used for that particular survey order. It contains autocad drawings, pdf copies of invoices, photos, etc.

There are several people who access these folders. For example, The field crew will save their field data and pictures into the folder. The draftsman will work with autocad files in that folder. Etc, etc etc.

The problem we run into sometimes is that a folder will accidentally get deleted, renamed, or moved into a neighboring folder, due to carelessness with the mouse or a keyboard stroke. This is a bad bad thing to have happen.

I am not very familiar with what kind of options I have as far as protecting a folder from deletion, renaming, or being moved, while still allowing unfettered access to create, delete, and modify the files inside that folder.

Here's the part relevant to Access: if Windows even has the capability of the type of protections for folders that I need... is there a way through VBA to assign those protections to a folder that is created with the VBA code?

Here is how the relevant portion of the OnClick event looks:
Expand|Select|Wrap|Line Numbers
  1. '   Create Folder on O: drive
  2.     yr = Left([FILE_NO], 4)
  3.     stOrdnum = Right([FILE_NO], 4)
  4.     stFileNumber = [FILE_NO]
  5.     stPathName = "O:\Orders_" & yr & "\" & [FILE_NO]
  6.     stFileName = [FILE_NO] & ".rtf"
  7.     stPFName = stPathName & "\" & stFileName
  8.  
  9.     If stOrdnum = "0001" Then
  10.         MkDir ("O:\Orders_" & yr)
  11.     End If
  12.  
  13.     If Dir$(stPathName, vbDirectory) <> "" Then  ' Does Path Already Exist?
  14. '       Yes No Box
  15.         Msg = "The directory " & stPathName & " Already exits! Do you want to continue?"    ' Define message.
  16.         Style = vbYesNo   ' Define buttons.
  17.         Title = "Directory Already Exists"    ' Define title.
  18.         Response = MsgBox(Msg, Style, Title)
  19.             If Response = vbNo Then    ' User chose No
  20.                 GoTo Exit_Create_Order_File_Structure_Click
  21.             End If
  22.     Else
  23.         MkDir Path:=(stPathName)   '  Create Directory Structure
  24.     End If
  25.  
Nov 18 '08 #1
4 1791
ADezii
8,834 Expert 8TB
Hello tdw, in all honesty, I think that this is a question that should be directed to your Network Administrator. It really is not considered an Access issue as far as I am concerned.
Nov 18 '08 #2
tdw
206 100+
I understand where you are coming from.
I was hoping that someone would already know how to code these kinds of protections into the VBA in Access.

Since the first hurdle is to find out if such a thing exists in Windows, I'll keep looking for that answer. I'll return to this question if I found that part out, so that at that point it will really be an Access question.

Thanks!
Nov 18 '08 #3
ADezii
8,834 Expert 8TB
You can Create, Manipulate, and Retrieve Properties from Folders, but to assign specific Access Rights to them programmatically, my guess would be that you would have to use the Windows API. This would not be a task to be taken lightly. When I get some free time, I'll see what I can come up with.
Nov 18 '08 #4
tdw
206 100+
You can Create, Manipulate, and Retrieve Properties from Folders, but to assign specific Access Rights to them programmatically, my guess would be that you would have to use the Windows API. This would not be a task to be taken lightly. When I get some free time, I'll see what I can come up with.
Thanks ADezii. Just as a clarification, I don't want to restrict access to the contents of the folders. I just want to prevent the folders themselves from being deleted, moved, or renamed. Some way of super-gluing the directory tree (while, of course, still allowing new folders to be created.)

But, I digress... the above really isn't Access, unless it can be done with VBA as a part of the new folder creation process.
Nov 18 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Robert Nolan | last post by:
This subject is probably simple to the readers, but I must be having one hell of a mental block cause I am beating my head against a wall. I need to create a simple folder tree that is about 3...
0
by: Mike Connor | last post by:
I am having trouble getting Conditional Folder creation & File insertion to work using VS .Net in a Deployment Project for a C# app. I am displaying a generic Textbox Dialog under the User...
4
by: DMTman | last post by:
Who can help me to create a backup strategy that will copy the backend.mdb into separate folders representing either the time, or just folders that are sequentially numbered. I need this for...
1
by: yoshitha | last post by:
Hi, In my application am using scrpting.dll to create folders and files. using filesystemobject's createtextfile method am creating file. and am displaying all the folders and their corrsponding...
3
by: sva | last post by:
Using C# for an application in which I am working on, I need to display the available shared folders on the computer that's running the application. The shared folder paths need to be in UNC format...
1
by: lecnac | last post by:
Sorry for the repost. I must have done something wrong when I tried to post my reply (I can't seem to find it). Anyway, I'd really appreciate any help that anyone could provide. My issue is...
3
by: Ray Booysen | last post by:
In our application, we merge documents for our clients. The directory structure is as follows: webroot ->bin ->Documents ->Company -> Company X
6
by: ananya choudhury | last post by:
I need to sort around 17000 folders, in according to the last modified date ( creation time is also fine with me). Here is my code string DirectoryList =...
1
by: Pascal | last post by:
Hi everybody I try to create folders from a list stored in a listbox. It works a "little"but, i would like to create these folders only if they don't exist. here is the code i use : Private...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.