Hi. I am trying to create an access database that will perform file backups for me. So I'll need to use code to do this. Okay, let's breakdown what I need to do into steps:
1) Set the UNC path of where all files are located (they will all be found in one main folder that contains sub-folders, so maybe we can set a particular location; assume this as Location A)
2) COPY all the files from there (which will all be TIF's) and PASTE them into a new specified backup location (assume as Location B). But the code must check if the file(s) exist (using the file name I assume) in this new location first. If they do already exist, it must not overwrite the ones pre-existing and skip past it to the next file. But if it's not existing, then it should copy them over.
3) After it's done doing that, it must MOVE the file in the old location (Location A) to a different location that I require (Location C). But once again, that should only happen if (in Step 2) the files got copied over into Location B. Or maybe if that's too complicated, the files just do that same thing as Step 2 and run a check if file exists and move them over to the new location (Location C) if not.
I also want this entire process logged into a table. So like I want the file name, date/time it was copied/moved and the user that performed the task populated in that table.
Now maybe this can all be coded to a single button that performs the tasks mentioned above. Or I could use an Application.FileDialog(PickType) type way of choosing the folder and it grabs all the files in the subfolders and does the same thing. Whatever seems more reasonable.
I have a template database I've just been playing around with from a previous database that I had to create for a directory list function. I'll attach it to this post. In it you'll find a file dialog picker process I just mentioned. If that's of any use than do have a look and play around with it as you please. But if that's not required and we can do everything in a single button click, I'm definitely welcome to that instead.
Thanks!
1) Set the UNC path of where all files are located (they will all be found in one main folder that contains sub-folders, so maybe we can set a particular location; assume this as Location A)
2) COPY all the files from there (which will all be TIF's) and PASTE them into a new specified backup location (assume as Location B). But the code must check if the file(s) exist (using the file name I assume) in this new location first. If they do already exist, it must not overwrite the ones pre-existing and skip past it to the next file. But if it's not existing, then it should copy them over.
3) After it's done doing that, it must MOVE the file in the old location (Location A) to a different location that I require (Location C). But once again, that should only happen if (in Step 2) the files got copied over into Location B. Or maybe if that's too complicated, the files just do that same thing as Step 2 and run a check if file exists and move them over to the new location (Location C) if not.
I also want this entire process logged into a table. So like I want the file name, date/time it was copied/moved and the user that performed the task populated in that table.
Now maybe this can all be coded to a single button that performs the tasks mentioned above. Or I could use an Application.FileDialog(PickType) type way of choosing the folder and it grabs all the files in the subfolders and does the same thing. Whatever seems more reasonable.
I have a template database I've just been playing around with from a previous database that I had to create for a directory list function. I'll attach it to this post. In it you'll find a file dialog picker process I just mentioned. If that's of any use than do have a look and play around with it as you please. But if that's not required and we can do everything in a single button click, I'm definitely welcome to that instead.
Thanks!