VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Compact Database using JRO (Jet & Replication objects)

Justin Spencer  (1 Submission)   Databases/Data Access/DAO/ADO   Visual Basic 3.0   Intermediate   Wed 3rd February 2021

I recently developed a database application and wanted to use only ADO and no DAO. I soon found out that compacting the Jet database was impossible using ADO (until 2.1+ came along that is). This code requires a reference to Microsoft Jet and Replication objects 2.1+ Library (which comes with ADO 2.1+). You can download this update from https://www.microsoft.com/data.

Assumes
I use this routine in the form_unload sub to compact the current database. If you were to try to compact while there was still an active connection, Jet locking would take over and return an error. Set the current connection to nothing before compacting (set mcn = nothing).

Returns
True or False depending on success of operation

Side Effects
Not aware of any

API Declarations
'## Requires reference to Microsoft Jet and Replication objects 2.1+ Library (Standard ADO 2.1+ feature).
public const PASSWORD = "password" 'replace with database password

Rate Compact Database using JRO (Jet & Replication objects) (6(6 Vote))
Compact Database using JRO (Jet & Replication objects).bas

Compact Database using JRO (Jet & Replication objects) Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters