Asp.net Crystal Report登录访问失败
问题:我在加载报告时看到登录信息窗口 我试了很多。阅读了很多论坛,但没有成功。下面是代码。我正在使用VS2010中最新的Crystal Report。Windows窗体 我使用的是access db 2010,只有密码。我不知道该使用什么用户名,而且我在access中从未提到过。我的CrystalReportViewer连接到数据集ReportingDS.xsd 请帮忙Asp.net Crystal Report登录访问失败,asp.net,crystal-reports,Asp.net,Crystal Reports,问题:我在加载报告时看到登录信息窗口 我试了很多。阅读了很多论坛,但没有成功。下面是代码。我正在使用VS2010中最新的Crystal Report。Windows窗体 我使用的是access db 2010,只有密码。我不知道该使用什么用户名,而且我在access中从未提到过。我的CrystalReportViewer连接到数据集ReportingDS.xsd 请帮忙 private static string StrCon = "Provider=Microsoft.ACE.OLEDB.12
private static string StrCon = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + Application.ExecutablePath.ToString().Substring(0, Application.ExecutablePath.ToString().LastIndexOf('\\')) + "\\Reporting.accdb;Jet OLEDB:Database Password=abc;";
public Report_Frm()
{
InitializeComponent();
}
private void Report_Frm_Load(object sender, EventArgs e)
{
ReportDocument cryRpt = new ReportDocument();
cryRpt.Load(@"C:\Users\chris\Documents\Visual Studio 2010\Projects\ReportingSystem\ReportingSystem\myReport.rpt");
cryRpt.SetDatabaseLogon("Admin", "abc", @"C:\Users\chris\Documents\Visual Studio 2010\Projects\ReportingSystem\ReportingSystem\ReportingDS", "Reporting.accdb");
crystalReportViewer.ReportSource = cryRpt;
//crystalReportViewer.Refresh();
}
代码在没有数据库提示的情况下为我工作:
Dim reportDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument
'load report
reportDocument.Load("C:\Documents and Settings\Administrator\Desktop\customer.rpt")
'set user-id/password
reportDocument.SetDatabaseLogon("Admin", "abc")
'bind to viewer
Me.CrystalReportViewer1.ReportSource = reportDocument
报告使用通过OLEDB连接的Access数据库。据我所知,他的Access数据库需要密码。@craig,是的,我需要密码。您的数据库需要密码吗?如果打开MDB文件,是否会提示您输入一个用户id/密码?@craig,是的,我需要db的密码。当您使用Microsoft Access打开此.MDB文件时,是否会提示您提供用户id和密码?如果是这样,这些值“Admin”/“abc”工作是否允许您访问该文件?