Can not get a password protected Access database to display in the Crystal Report Viewer
Posted on 2011-03-17
I am using the latest Crystal Report Viewer for Visual Studio 2010.
This is what my connection string looks like:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Dev\Access\TestDB.mdb;User ID=testWebApp;Password=mypassword;Jet OLEDB:System database=C:\Dev\Access\TestDB\Security.mdw
I was able to bind the database to a GridView using the above connection string.
This is how I tried to set the connection:
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.DatabaseName = "C:\\Dev\Access\\TestDB.mdb";
connectionInfo.UserID = "testWebApp";
connectionInfo.Password = "mypassword";
connectionInfo.ServerName = "C:\\Dev\Access\\TestDB.mdb";
When I run the page that has the viewer I get prompted to enter my username and password. Even when I enter my username and password the report does not disply; it just redisplay the login window.
The problem may be related to the mdw file that Access uses for password protection.