[AccessD] Creating Subdirectories

Tony Septav iggy at nanaimo.ark.com
Sun Oct 19 11:14:33 CDT 2008


Hey Jurgen
I think you got it sort of. I have to work on this.
I did put an empty data.mdb into the folder.
In 2 steps
If the file exists I kill the file then RMDir the folder.
First time I get the error message on RMDir, second try works fine, same 
if I don't put the file in the folder.
As I say I am getting closer, it will just take a bit of poking around.

Thanks again

Jurgen Welz wrote:

>I just tried making and then deleting a folder in the same sub procedure with a hard coded folder beneath our S:\GOM folder and there was no difficulty.  I checked explorer to verify that the folder did not preexist before running the code.  Should there have been an exisiting folder, I would  have had to first delete any files or sub folders below the GOM\toe\ root.
>
>Public Sub MkRmDir()
>    MkDir "s:\Gom\toe"
>    If GetAttr("s:\Gom\toe") And vbDirectory Then
>        MsgBox "Folder created"
>        RmDir "s:\gom\toe"
>        If Len(Dir("S:\Gom\toe")) Then
>            MsgBox "Creation succeeded and Deletion failed"
>        Else
>            MsgBox "Creation and Deletion succeeded"
>        End If
>    Else
>        MsgBox "folder creation failed"
>    End If
>End Sub
>
>Running the code reports creation, then creation and deletion of the folder.
>Folder deletion always fails when there are files in the folder.  Could that be an issue?
>
>Ciao
>Jürgen Welz
>Edmonton, Alberta
>jwelz at hotmail.com
>
>  
>
>>Date: Sun, 19 Oct 2008 08:01:44 -0700
>>From: iggy at nanaimo.ark.com
>>To: accessd at databaseadvisors.com
>>Subject: [AccessD] Creating Subdirectories
>>
>>Hey All
>>Thanks to all of you that responded. Yesterday was a "tired brain day".
>>This morning I built a little routine using MKDIR to check and create
>>the necessary subdirectories. I check first to see if the drive exists.
>>Incorporated Jurgen's idea to check to see if the folder/directory was
>>created (rights issue).
>>One little glitch is if I try to delete the folder immediately after
>>creating it, I get a message "Cannot delete folder. It is being used by
>>another person or program". I have to exit Access and then I can delete it.
>>
>>Thanks again
>>--
>>AccessD mailing list
>>AccessD at databaseadvisors.com
>>http://databaseadvisors.com/mailman/listinfo/accessd
>>Website: http://www.databaseadvisors.com
>>    
>>
>
>_________________________________________________________________
>
>
>  
>




More information about the AccessD mailing list