[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Backing up Access Database

Posted on 2003-11-13
6
Medium Priority
?
217 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

656 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