[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Backing up Access Database

Posted on 2003-11-13
6
Medium Priority
?
218 Views
Last Modified: 2010-05-03
I have an Access database that I want to automatically make a backup copy of it daily and place the copy in a different directory.  Just, wondering, is this doable in VB application?  If so, how do I do it?

Thanks in advance.
Bing
0
Comment
Question by:JamesBing
5 Comments
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 9741378
You could just as easily do it with a batch file, but VB could certainly do it as well.

1) Are you wanting your backup "app" to be running constantly, and then make a backup when it sees that it is time?

2) Do you just want a backup whenever you bootup?

3) Do you want to use "Scheduled Tasks" in windows to run your backup app at a specified time?

Many options...let us know.

Idle_Mind
0
 

Author Comment

by:JamesBing
ID: 9741419
I want to run at a certain time say 10AM.

I wrote a batch file to do this, but somehow it doesn't work.  I mean, it does work, but I don't know what happen recently it doesn't work anymore (http://www.experts-exchange.com/Operating_Systems/MSDOS/Q_20797170.html).  That's why I'm writing it in VB.

bing
0
 
LVL 4

Accepted Solution

by:
TomLaw1999 earned 1000 total points
ID: 9741793
Hi James,

If this is a plain Access  MDB file you can copy it with the copyfile API function.

Just declare it like this:

Public Declare Function apiCopyFile Lib "kernel32" Alias "CopyFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal bFailIfExists As Long) As Long

Then call it from your program using something like this:

CopyFile Serverpath & "System7.mdb", "C:\Adir\Client.bak"

In this example System7.mdb represents the access data file
Client.bak is the backup copy

I suppose you could get your program to check the system time and back up at the same time every day.

0
 
LVL 4

Expert Comment

by:TomLaw1999
ID: 9741800
The beauty about using the Copyfile function is that it will allow you to copy a file whilst it is still open.
0
 
LVL 3

Expert Comment

by:Basker
ID: 9749567
Better thing is to create another program to take care backups,cleanup stuff etc. In that program you can allow the users to customize the backup time, etc., Make sure the program is running for 24 hrs.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question