?
Solved

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

Posted on 2011-03-17
2
Medium Priority
?
462 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 101

Expert Comment

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

mlmcc
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

801 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