We help IT Professionals succeed at work.

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.

Bobbi
Comment
Watch Question

Commented:
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

Author

Commented:
OK.  Thanks for the advice.  
Top Expert 2014

Commented:
@BobbiD

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.

Author

Commented:
Hi,  

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.  
thanks,
thanks,
bobbi
Top Expert 2014

Commented:
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.

Author

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.
Top Expert 2014

Commented:
* 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)

Author

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?

Bobbid
Top Expert 2014

Commented:
when will you get back to this problem?

Author

Commented:
next week?

Author

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?

B
Top Expert 2014

Commented:
probably.  What are the rules you have to follow in determining when to copy the file?

Author

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 !

Author

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.

thanks,
Top Expert 2014

Commented:
What is the date part of the copy?

Author

Commented:
There are not copies at this present time but would like to add mm/dd/yyyy.

thanks,
B
Top Expert 2014

Commented:
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.

Author

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.
Top Expert 2014
Commented:
in your VB code, close the database and the use the Filecopy statement to copy the database file (.mdb) to the backup location.

Author

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.
Top Expert 2014

Commented:
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.

Author

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.
Top Expert 2014

Commented:
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 Liss"There is still no cure for the common birthday." ~John Glenn
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.