I'm developing a window application in C# and was considering establishing your password on mdb file of MS-Access to ensure that no-one can open that file apart from my window application or who so ever knows password of this file.

I handled to create that file password protected but regrettably I wasn't in a position to access that file through my application. Really i not receiving where you can set the consumer title and password to spread out that file. Entering account information in connection string isn't working.

EDIT Sorry for bit confusion

I would like that file to become password protected instead of database connection. That file shouldn't be opened up regardless. For your i handled to create password on file using ms access itself however i m unable to open that file through my application.

Edit2: "Provider=Microsoft.Jet.OLEDB.4.0Data Source=E:ProjectsGargTubesdbGargTubes.mdb User Id="" Password="abc""

I'm using MS-Access 03

Edit 3:

Provider=Microsoft.Jet.OLEDB.4.0Data Source=E:ProjectsGargTubesdbGargTubes.mdb Database Password=abc"

Provider=Microsoft.Jet.OLEDB.4.0Data Source=E:ProjectsGargTubesdbGargTubes.mdbJET OLEDB: Database Password=abc

Error: Couldn't find installable ISAM

You are able to have a look into that connection strings samples: Connection strings for Access

Try setting the database password inside your connection string:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;Jet OLEDB:Database Password=MyDbPassword;

As you are speaking about passing user title and password, I suppose you have protected your database by setting user privileges instead of while using "database password" option. For the reason that situation, customers and groups are saved in system.mdw. Make sure to include the road to system.mdw inside your connection string (Jet OLEDB:System Database=path\to\system.mdw, see Connection strings for Access for samples).

Alternatively, you apply the "database password" feature. Then, the Jet OLEDB:Database Password option referred to within the other solutions should work. To spell it:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\Projects\GargTubes\dbGargTubes.mdb;Jet OLEDB:Database Password=abc