I'm using Jet Replication Objects (JRO) in VB6 to compact a password-protected Access 97 database. It works like it should but after compaction the database is no longer password protected. Here is the code that I'm using:
What am I missing?
Code:
Dim je As New JRO.JetEngine
If Dir(App.Path & "\db1.mdb") <> "" Then Kill App.Path & "\db1.mdb"
je.CompactDatabase "MyDb.mdb;Jet OLEDB:Database Password=PASSWORD;", _
"Data Source=db1.mdb;Jet OLEDB:Engine Type=4;Database Password=PASSWORD;"
Name App.Path & "\db1.mdb" As App.Path & "\MyDb.mdb"