Solved

Back-up and restore frome within VB5

Posted on 1998-09-21
3
137 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
Comment Utility
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
Comment Utility
You could also use PKZIP/PKUNZIP (or WINZIP) for same task.

M
0
 
LVL 5

Accepted Solution

by:
chewhoung earned 50 total points
Comment Utility
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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now