Now i have database already in my folder but size of file is biggest.Then i want to compact this file but i get some error about "Invalid argument.", How can i do in this case. thank u
this my code
Dim JRO As New JRO.JetEngine
Dim source = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & System.AppDomain.CurrentDomain.BaseDirectory & "Code7.accdb"
Dim compact = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & System.AppDomain.CurrentDomain.BaseDirectory & "newCode7.accdb;Jet OLEDB:Engine Type=5"
JRO.CompactDatabase(source, compact)
'delete orinal file
System.IO.File.Delete(System.AppDomain.CurrentDomain.BaseDirectory & "Code7.accdb")
'rename compact file to original file name
File.Move(System.AppDomain.CurrentDomain.BaseDirectory & "newCode7.accdb", System.AppDomain.CurrentDomain.BaseDirectory & "Code7.accdb")
MessageBox.Show("The database was compacted successfully")