when report is loaded then it asks for the user name and password it's very shocking for me cos i haven't used any user name or password while at the time of creating Database in MS ACCESS. and i don't know which password and username is required for the report weither it's database username and passwrod or any thing else ..... i have used following code to
DetailRpt rpt = new DetailRpt();
rpt.Refresh();
crystalReportViewer1.ReportSource = rpt;
crystalReportViewer1.SelectionFormula = "{Archival_Scanning.Assign_To}='" + txtName.Text + "'";
Login error while loading crystal report using MICROSOFT ACCESS DB
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Mohammed Sobhi2 reputationPosted Aug 31, 2009, 12:45 AM EDT
ReportDocument rptdocReport = new ReportDocument();
rptdocReport.SetDatabaseLogon("", "", Database Path ,Database Name, true);
foreach (CrystalDecisions.CrystalReports.Engine.Table myTable in rptdocReport.Database.Tables)
{
TableLogOnInfo logInfo = myTable.LogOnInfo;
logInfo.ConnectionInfo.ServerName = Database Path;
logInfo.ConnectionInfo.DatabaseName = Database Name;
logInfo.ConnectionInfo.UserID = "";
logInfo.ConnectionInfo.Password = "";
myTable.ApplyLogOnInfo(logInfo);
}