Compact Database in VB6

5 pts.
Tags:
Development
Visual Basic
I would like to compact a database in VB6. Can someone please give me step by step directions. Thank you

Answer Wiki

Thanks. We'll let you know when a new response is added.

What kind of database is it?

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Randym
    I have done this. sDBPath and sDBNameBak come from a table earlier Public Sub JROCompactDatabase() Dim je As New JRO.JetEngine Dim dbName As String Dim dbBakName As String On Error GoTo ERRH dbName = sDBPath & sDBName dbBakName = sDBPath & sDBNameBak If Dir(dbBakName) "" Then Kill dbBakName Name dbName As dbBakName je.CompactDatabase "Data Source=" & dbBakName & ";Jet OLEDB:Engine Type=4;", "Data Source =" & dbName & ";Jet OLEDB:Engine Type=4;" Cleanup: Set je = Nothing Exit Sub ERRH: If Err.Number
    1,740 pointsBadges:
    report
  • Grappler
    HI there, I have developed a quick and easy app for tracking Computer Equipment within my organization. Here is some quick code that will: 1. Create a new Compacted Database 2. Delete the old Backup 3. Create a new Backup from the original database If mCompactDatabase = 1 Then cmdCancel.Enabled = False Command1.Caption = "&Please Wait ..." DBEngine.CompactDatabase "C:INVENTDATAINVENT.MDB", "C:INVENTDATAINVNEW.MDB", "", dbEncrypt Kill "C:INVENTDATAINVENT.BAK" Name "C:INVENTDATAINVENT.MDB" As "C:INVENTDATAINVENT.BAK" Name "C:INVENTDATAINVNEW.MDB" As "C:INVENTDATAINVENT.MDB" Command1.Caption = "Process &Complete" End IF Hope you can follow the logic (it is pretty simple) and I sure hope this helps. Thank you and have a great day. Do not hesitate to contact me if you have any questions on this. Gary R. Primrose gprimrose@bearskinairlines.com
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following