Solved

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

Posted on 2011-03-17
2
452 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
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…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

770 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