?
Solved

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

Posted on 2011-03-17
2
Medium Priority
?
469 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

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.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
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…

649 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