Solved

Can not get a password protected Access database to display in the Crystal Report Viewer

Posted on 2011-03-17
2
453 Views
Last Modified: 2012-06-27
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";

SetTableLocation(customersByCityReport.Database.Tables, connectionInfo);

Problem:

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.
0
Comment
Question by:dmoss123
2 Comments
 

Accepted Solution

by:
dmoss123 earned 0 total points
ID: 35158843
I found a very odd solution.

It works if I change

connectionInfo.Password = "mypassword";

to

connectionInfo.Password = Convert.ToChar(10) + "mypassword";
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 35159003
That is the solution.  For some reason Crystal requires the linefeed before the password.

mlmcc
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question