Solved

Back-up and restore frome within VB5

Posted on 1998-09-21
3
142 Views
Last Modified: 2010-04-30
Is there an OCX which make it possible to make back-up's from within VB5. So it must be possible to back-up and restore the databases from my application
0
Comment
Question by:rossel
  • 2
3 Comments
 
LVL 12

Expert Comment

by:mark2150
ID: 1435920
Umm, dunno if I'd use BACKUP/RESTORE that comes with DOS/Windows.

Are you trying to go to floppies, tape, LAN or duplicate on disk?

Simplest would be to use the database compaction function in Access and save old version for later. This gives you a backup and cleans up database at same time.

Call busy("Please wait," + vbCrLf + "Repairing Database" + vbCrLf + "DO NOT INTERRUPT!")
'
On Error GoTo skipkill
Kill "ltdata1.mdb"
DBEngine.RepairDatabase "ltdata.mdb"
Name "ltdata.mdb" As "ltdata1.mdb"
Call busy("Please wait," + vbCrLf + "Compacting Database" + vbCrLf + "DO NOT INTERRUPT!")
'
DBEngine.CompactDatabase "ltdata1.mdb", "ltdata.mdb"
Call unbusy
'
reply = MsgBox("Database maintenance/compression complete, old data file is: LTDATA1.MDB", vbOKOnly, "Database Maintenance")
GoTo drain
' =================
'
' Here on file not exist on kill
'
skipkill:
Resume Next
' =================
'
drain:

0
 
LVL 12

Expert Comment

by:mark2150
ID: 1435921
You could also use PKZIP/PKUNZIP (or WINZIP) for same task.

M
0
 
LVL 5

Accepted Solution

by:
chewhoung earned 50 total points
ID: 1435922
If you want a FREE OCX for zipping and unzipping, here's one:
http://www.download.com/PC/Result/TitleDetail/0,4,0-54622,1000.html

or search ZIP at:
http://www.download.com/PC/Activex/0,271,0-0,00.html
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

856 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