Solved

Back-up and restore frome within VB5

Posted on 1998-09-21
3
141 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA error replacing data 6 40
Prevent user closing word document opened with VB6 6 74
clicking a shape in a frame array vb6 3 45
vbModal 12 53
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…

822 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