[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How do I repair and compress an Access database from VB

Posted on 1998-06-18
2
Medium Priority
?
146 Views
Last Modified: 2010-05-03
How do I repair and compress an Access database from VB?
0
Comment
Question by:jfl
[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
2 Comments
 
LVL 2

Accepted Solution

by:
swilt earned 80 total points
ID: 1463648
This sub repairs and then compacts a database

sFile is the path of the database e.g. C:\DATA\MYMDB.MDB
sTempFile is the temporary file used in compation eg C:\DATA\MYMDB.TMP
When a database is compacted it must not be open

Private Sub Compact(ByVal sFile As String, ByVal sTempFile As String)
    On Error GoTo EHCompact
   
    RepairDatabase sFile
    CompactDatabase sFile, sTempFile
    Kill sFile
    Name sTempFile As sFile
ExitCompact:
    Exit Sub
   
EHCompact:
    MsgBox "Error occurred whilst trying to compact database " & sFile & vbCr & Error$, vbCritical, Me.Caption
    Resume ExitCompact
End Sub
0
 

Author Comment

by:jfl
ID: 1463649
I have another question here that I think you can help with:
http://www.experts-exchange.com/topics/comp/lang/visualbasic/Q.10058529
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

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.
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…
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