When a user exits my application I want them to be able to create a Directory and subdirectory to backup the back end to.
How do I create say "C:\My_app\backup" using code - if it does not already exist?
the aim is store once, not store multiple times
Remember... Optimize 'til you die!
Progaming environment: Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010 VB based on my own environment: vb6 sp5 ASP based on my own environment: 5.6 VB-NET based on my own environment started 2007 SQL-2005 based on my own environment started 2008 MYLE YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.
If that doesn't work then I would begin to suspect some kind of networking permissions issue. I use this command very often and I have never seen it fail unless the folder already exists or there are permission restrictions at the OS level.
Sorry - I wanted to do it all in one go. This will be a text string from the field on my backup form. The user will be asked to type in the folder that they want to back up to. If it doesn't exist then I want my application to be able to create it for them. They might type in "C:\my_app\backup\" or something else containing a subfolder.
I was able to do this with VBA code. Don't ask me where I found the code - probably bits and pieces from the code bank cobbled together with code from other places.
'Check to see if theres a "GPS" folder on drive Y:\
'If it doesn't exist, create it
Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FolderExists("Y:\gps")) Then
' If the folder exists, do Nothing
'MsgBox ("The folder already exists")
'Create gps folder in Drive Y:
'MsgBox ("GPS Folder now exists in Drive Y:\")
This is part of a much larger procedure that I had trouble getting right, so I put in message boxes at each statement to help troubleshooting - that's why they're commented out in the above code. Drive Y is mapped to the user's home directory on the network, so they have all the necessary permissions.
I assume that once you've created the parrent directory, you can create subdirectories using the same procedure. There may be some DAO or ADO Reference Library that needs to be installed for this to work properly, but I learned long ago to do a "complete" install of Microsoft Office, so they're already on my workstations.