Solved

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

Posted on 2011-03-17
2
449 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
Comment Utility
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
Comment Utility
That is the solution.  For some reason Crystal requires the linefeed before the password.

mlmcc
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now