A lot of newbies are facing security problems, when they try to connect to a Microsoft Access Database ( mdb file) from ASP.NET, using oledb. This is because, the ASPNET user account in Windows doesn't have security access to the mdb file by defualt. ASP.NET uses the ASPNET user account for connecting to the database. To solve this,
- Right click the Access database file, click properties.
- Click the security tab in properties dialog box.
- Add the user ASPNET to the security list, and provide full control (check allow full control checkbox)
- If you can't see the security tab when you take properties, it is because 'simple file sharing' is enabled by default. Use windows explorer->Tools->Folder Options to disable simple file sharing.