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 = " +
"FileTmp.mdb";
if( System.IO.File.Exists("FileTmp.mdb") )
System.IO.File.Delete("FileTmp.mdb");
JRO.JetEngineClass objJet = new JRO.JetEngineClass();
objJet.CompactDatabase(strTargetPath, destConnection);
System.IO.File.Delete(targetPath);
System.IO.File.Move("FileTmp.mdb", targetPath);
} //End of compactAccessDB.
--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...sharp/200511/1