-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
The correct term is Compact & Repair. Use the DAO
"DBEngine.Compa ctDatabase" method.
This example is in VBA & from the Access VBA help file. Perhaps you can
translate to C++/OLEDb.
Sub CompactDatabase X()
Dim dbsNorthwind As Database
Set dbsNorthwind = OpenDatabase("N orthwind.mdb")
' Show the properties of the original database.
With dbsNorthwind
Debug.Print .Name & ", version " & .Version
Debug.Print " CollatingOrder = " & .CollatingOrder
.Close
End With
' Make sure there isn't already a file with the
' name of the compacted database.
If Dir("NwindKorea n.mdb") <> "" Then _
Kill "NwindKorean.md b"
' This statement creates a compact version of the
' Northwind database that uses a Korean language
' collating order.
DBEngine.Compac tDatabase "Northwind.mdb" , _
"NwindKorean.md b", dbLangKorean
Set dbsNorthwind = OpenDatabase("N windKorean.mdb" )
' Show the properties of the compacted database.
With dbsNorthwind
Debug.Print .Name & ", version " & .Version
Debug.Print " CollatingOrder = " & .CollatingOrder
.Close
End With
End Sub
--
MGFoster:::mgf0 0 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBQXrcFYechKq OuFEgEQLYUwCgzd V2bvnf+cgWDEHuD rF0xgLmXeIAn3af
k6AXGDumADY4P43 Oy7vx7b59
=o5LA
-----END PGP SIGNATURE-----
Riley DeWiley wrote:
Subject says it all. I am writing in C++/OLEDB and want to compress + repair
from my program, what do I have to do?