为什么 Crystal Report Viewer 总是要求在 WePOS 操作系统上访问 Access 数据库的登录详细信息? [英] Why does Crystal Report Viewer always asks for login details to Access database on WePOS operating system?

查看:20
本文介绍了为什么 Crystal Report Viewer 总是要求在 WePOS 操作系统上访问 Access 数据库的登录详细信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Crystal Reports XI 编写了一份报告,该报告链接到此处的 Access 数据库 C:MyData.mdb.

I wrote a report using Crystal Reports XI linked to an Access database here C:MyData.mdb.

报告有一个字段(在此示例中进行了简化),没有子报告.

The report has one field (simplified for this example) and no sub-reports.

我使用 C# .NET 4 使用 Forms 和 WPF Cyrtsal Report Viewer.

I have used the Forms and WPF Cyrtsal Report Viewer using C# .NET 4.

报告在我的运行 Windows XP 的开发 PC 上成功查看,并且在其他tils"上也运行 Windows XP.

但是,在运行前的 WePOS(一种缩减的 Windows XP)上,报告总是"显示一个对话框,询问登录详细信息,即用户名和密码.

此对话框还显示 C:MyData.mdb 的正确路径.

This dialog box also shows the correct path to C:MyData.mdb.

我为此花费了很多天,以各种可能的方式进行测试(我相信每个人都记得这样的时代!).

I have spent many days on this, testing in every way possible (I'm sure everyone remembers times like these!).

我使用此代码确保数据库正确链接到:

I use this code to ensure the database is correctly linked to:

TableLogOnInfo logonInfo;

foreach (CrystalDecisions.CrystalReports.Engine.Table table in report.Database.Tables)
{
    logonInfo = table.LogOnInfo;
    logonInfo.ConnectionInfo.ServerName = string.Empty;
    logonInfo.ConnectionInfo.DatabaseName = "C:MyData.mdb";
    logonInfo.ConnectionInfo.UserID = string.Empty;
    logonInfo.ConnectionInfo.Password = string.Empty;
    table.ApplyLogOnInfo(logonInfo);
}

...它适用于每台装有 Windows XP 的电脑,除了装有 WePOS 的电脑.

... and it works on every PC with Windows XP, except the one with WePOS.

我也玩过:

report.SetDatabaseLogon(string.Empty, string.Empty, "C:MyData.mdb", string.Empty);

...不过没什么区别.

... but It makes no difference.

  1. Access 数据库中没有用户名或密码
  2. 所有使用的 PC 都安装了相关软件(运行时等)
  3. 所有 PC 均使用 Adminstrator 帐户进行了测试(并仔细检查了文件权限)
  4. 我尝试勾选集成安全复选框,但没有成功
  5. 我设置 logonInfo.ConnectionInfo.DatabaseName = string.Empty;
  6. 我设置 logonInfo.ConnectionInfo.ServerName = "C:MyData.mdb";
  7. 我尝试不使用上述任何代码,而是确保数据库在所有 PC 上的同一位置,但没有运气
  8. 这是一个 Access 2003 数据库文件

我只能得出结论,WePOS 是如此削减",以至于 Crystal 默默地未能通过身份验证......请帮忙!

I can only conclude WePOS is so "cut down" that Crystal is silently failing to pass authentication... please help!

推荐答案

仅供参考,如果您切换到 SQL Server,您将希望使用 SQL OLEDB 而本机 Sql Client 或当我第一次将 CR 集成到我们的应用程序中时,您将再次遇到同样的问题.它可以在您的开发机器上正常运行,但不能在生产环境中运行.

Just for future reference, if you ever switch to SQL Server you will want to use SQL OLEDB and NOT the native Sql Client or you will run into the same problem again as I also did when I was first integrating CR into our app. It will work fine on your development machine but not in production.

这篇关于为什么 Crystal Report Viewer 总是要求在 WePOS 操作系统上访问 Access 数据库的登录详细信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆