I get an "Could not find installable ISAM." But the error does not make
sense. to me. I converted this code to C# that I found on the internet:
( http://www.vbcity.com/forums/faq.asp...ccess#TID42009 )
What might be wrong ?
I have a reference to msjro.dll version 2.81.1117.0 which show up as
interop.jro in my references.
THE FUNCTION:
public bool changePassword( string SourceDB,string DestDB,string
OldPswd,string NewPswd)
{
bool retval=false;
string SourceCNN;
string DestCNN;
JRO.JetEngine jro = new JRO.JetEngine() ;
// delete the backupfile if exists
try
{
if (File.Exists(De stDB)==true)
{ File.Delete(Des tDB);}
// Build the connection strings
SourceCNN="Prov ider=Microsoft. Jet.OLEDB.4.0" + ";Data Source=" + SourceDB +
";Jet OLEDBatabase Password=" + OldPswd;
DestCNN="Provid er=Microsoft.Je t.OLEDB.4.0" + ";Data Source=" + DestDB +
";Jet OLEDBatabase Password=" + NewPswd;
// Create the replica with the new password
jro.CompactData base(SourceCNN, DestCNN);
// overwrite the old one with the new one and delete the temp.
File.Delete(Sou rceDB);
File.Copy(DestD B,SourceDB,true );
File.Delete(Des tDB);
retval=true;
}
catch( Exception e )
{
Console.WriteLi ne(e.Message);
}
return retval;
}
--
Thanks Andrew