-1

I have some .mdb file which contains password and others do not. I need some logic behind in C# where I can check for .mdb file whether it contains password or not and if 'yes', how can I open that database using C#.

Please help

Shivakumar
  • 15
  • 3
  • 2
    Try to connect to it without a password and see if you can get in. – Dai Dec 06 '16 at 06:59
  • As for opening connection, the [OdbcConnection support password](http://stackoverflow.com/questions/10374808/how-to-connect-to-a-ms-access-file-mdb-using-c) – Martheen Dec 06 '16 at 07:08
  • If I try connect database having password, it throws an exception "Invalid password" – Shivakumar Dec 06 '16 at 07:10

1 Answers1

1
  1. First try to connect to the database, without a password, within a "try catch".
  2. if it falls to a "catch" block, then try to connect with a valid password.