-
Using VB6 and Access 2000
When you want to compact a database and your using ADO,
do you still use:-
DBEngine.CompactDatabase "olddb", "newDB"
In the VB docs it only ever references DAO when you
look up CompactDatabase
Is there another way?
Thanks,
SeanR
-
compact a database using ADO
Code:
'uses ADO 2.x and Microsoft Jet and Replication Objects 2.x
'declare variables
Dim objJRO As JRO.JetEngine
Dim strConnSource As String
Dim strConnDestination As String
'set connection string info
strConnSource = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Nwind2k.mdb"
strConnDestination = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\NewDb.mdb"
'instantiate object
Set objJRO = New JRO.JetEngine
'compact database from source to destination
objJRO.CompactDatabase strConnSource, strConnDestination
'release objects
Set objJRO = Nothing
-
Thanks for your help ClientP
-
ClientP?
Close enough.... :)
-
Sorry abount that ClunietP.
It should teach me to look more closely and not
just scan.
SeanR