MyTetra Share
Делитесь знаниями!
Сжатие2
12.10.2019
20:37
Текстовые метки: VBA_Access, Compress
Раздел: !Закладки - VBA - Access - Compress

Private Sub Compactdb()


Dim JRO As JRO.JetEngine

JRO = New JRO.JetEngine


Dim source = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Forte\Fortedb.accdb"

Dim compact = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Forte\Compactdb.accdb"

JRO.CompactDatabase(source, compact)


'Original (not compacted database is deleted)

System.IO.File.Delete("C:\Forte\Fortedb.accdb")


'Compacted database is renamed to the original databas's name.

File.Move("C:\Forte\Compactdb.accdb", "C:\Forte\Fortedb.accdb")


'User notification

MsgBox("The database was compacted successfully")


End Sub

 
MyTetra Share v.0.52
Яндекс индекс цитирования