Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CompactDatabase removes password protection

Status
Not open for further replies.

jbradley

Programmer
Sep 7, 2001
248
0
0
US
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:
Code:
Dim je As New JRO.JetEngine

If Dir(App.Path & &quot;\db1.mdb&quot;) <> &quot;&quot; Then Kill App.Path & &quot;\db1.mdb&quot;

je.CompactDatabase &quot;MyDb.mdb;Jet OLEDB:Database Password=PASSWORD;&quot;, _
    &quot;Data Source=db1.mdb;Jet OLEDB:Engine Type=4;Database Password=PASSWORD;&quot;

Name App.Path & &quot;\db1.mdb&quot; As App.Path & &quot;\MyDb.mdb&quot;
What am I missing?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top