472,125 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,125 software developers and data experts.

Access database password removed after compacting - why???

Hi all

The below code is compacting a database that has a password. Unfortunately
once the below code is complete the database does not have a password anymore.
How do I have it so the password remains or re-create the password on the
compacted database?? For example say the password on this database is :
'abcdef'. Thanks in advance.

public void compactAccessDB(string targetPath, string strTargetPath )
string destConnection = @"Provider=Microsoft.Jet.OLEDB.4.0;Data source = " +

if( System.IO.File.Exists("FileTmp.mdb") )

JRO.JetEngineClass objJet = new JRO.JetEngineClass();
objJet.CompactDatabase(strTargetPath, destConnection);

System.IO.File.Move("FileTmp.mdb", targetPath);
} //End of compactAccessDB.

Message posted via DotNetMonster.com
Nov 25 '05 #1
0 1066

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by latosca68 | last post: by
6 posts views Thread by owengoodhew | last post: by
5 posts views Thread by Nathan | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.