VB app that copies a database backend to c drive in increments

Hi, I need a visual basic utility that will copy database tables located in access backend to c drive upon close of database which has a vb front end.  I do not want to do a full copy each time but copy new information entered into the database for that day.  The application will be used on laptops that are used in the field.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bobbi, do you have a question?

Chances are you're not going to get too many responses if you're asking someone to write you a complete utility app.
BobbiD, if you need someone to create the entire app, try this site:  http://www.vworker.com

People will bid on your project, you may be able to have it written for under $100
BobbiDAuthor Commented:
OK.  Thanks for the advice.  
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.


Your environment seems to be one that I might describe with words like:
* synchronized
* briefcase model
* database replication

I'm not sure you need an application or utility, but it is difficult for me to recommend a solution without a lot more information from you.
BobbiDAuthor Commented:

the backend is Access with replication so the data will be replicated when connected. I am looking for a vb project that I saw in the internet a while ago that will make a separate copy of the backend data upon closing of the application and save (append) any data that was entered that day to the copy of the backend.  This is to ensure that if there is an issue where the data in the backend database gets deleted we can always get the data from the copy made from the previous day.

Please let me know of any or have any other vb project that has a similar function that can copy the backend data upon closing of an application.  
why not just copy the production database file (.mdb) completely?

for one of my clients, I start the nightly batch job with a backup of the separate databases before I repair and compact them.  You don't even need a VBscript program for the copy-to-backup, just good old DOS batch commands.

Though you could add a Filecopy statement to the bottom of your VB6 program to do the backup.
BobbiDAuthor Commented:
I am new to VB - how do I add a Filecopy statement to the bottom of VBprogram and will this backup the whole database each time upon closing or only get the data that was entered for that time.
* I can't help you add a statement to your program.  You will have to edit the program source code yourself.

* Look at the online help for the Filecopy statement.  It has two parameters for the source path and destination path.  It probably invokes the COPY command you would find at the command prompt.

* You are copying the entire database file (.mdb)
BobbiDAuthor Commented:
I've had to drop this for a time to work on another project and have not had time to look into this. Can we put this question on hold or archived?

when will you get back to this problem?
BobbiDAuthor Commented:
next week?
BobbiDAuthor Commented:
this is a program that is on a laptop and will be used offsite so I will need to copy the file when they exit the program but they may exit the program several times a day and do not want to make more than one copy.  Is this possible?

probably.  What are the rules you have to follow in determining when to copy the file?
BobbiDAuthor Commented:
Sorry, I did not abandon question just needed more time - working on something else with fierce deadline.  the rules to determine when to copy the file is when the user exits out of the database.  There is an exit button on the main screen and I guess I need a command that copies the database.  I do not want to make extra copies just replace the copy that was there prior because they will be opening and closing the database several times a day.
Thanks !
BobbiDAuthor Commented:
 I am looking for a process whereby the tables in an .mdb backend is backed up to the c drive with a date dd/mm/yyyy using a dos batch or something faster - zipped too would be great since there is a great amount of data being collected.

My front end is vb6.  I don't want a different copy each time there is a backup - just replace the last one copied.

What is the date part of the copy?
BobbiDAuthor Commented:
There are not copies at this present time but would like to add mm/dd/yyyy.

I don't understand where the date would be.  If you only want to have one backup copy, adding the date to the name would create duplicates.
BobbiDAuthor Commented:
I was thinking of adding a date to the end of the database name -  database012712.mdb and I guess if I see that the date is current that will tell me that the bawckup was successful.

I do not want copies just overwrite what is there.  I am new to vb and do not know how to accomplish this.
in your VB code, close the database and the use the Filecopy statement to copy the database file (.mdb) to the backup location.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BobbiDAuthor Commented:
I need to copy just the tables in the .mdb and not the entire database.  Can this be done calling a DOS batch file copy in vb6?

I am looking at other sites and there is mention of this but I don't know where to start with it and was hoping for guidance and may be someone has code that they can share.
Not having any idea of the tables and data, I don't think I can advise you in detail.  The tables and row data are all in a single file.  It is much easier and quicker to copy the entire .mdb file and then extract the rows you need at a later time.

It might be possible, but you've got a lot of work ahead of you.  For instance, we don't even know what format the extracted rows should take or how they are to be used.
BobbiDAuthor Commented:
ok.  thanks.  reason I am asking is because I saw one being used a while back where the .mdb was being copied but only the tables inside the .mdb was copied and added a date but just replaced what was there each time the user closed the database and the vb script was calling a DOS window which ran minimized, then closed with a message.  Just thought someone on this site might have come across something similar.
Saving data changes isn't as simple as you might be thinking.  

For instance...
* What do you do with deleted rows?  
* Is there a reliable timestamp for each row that is updated (reliably) with the application code/queries?
* If multiple users access the same database, are their user IDs logged with the changes?
* What is to be done with the changes?
* What algorithms/schemes do you use to resolve conflicts?

None of the experts here has any idea what your database tables look like, much less any idea of the context of your question.

For one of my applications, the users click an icon on their desktop at the end of their work day.  It copies the local Access database to the server.  Each night, a scheduled task consolidates the data from each uploaded database.
Martin LissOlder than dirtCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.