C# Crystal Report:无法连接错误的登录参数

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1087464/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 07:54:26  来源:igfitidea点击:

Crystal Report: Unable to connect incorrect log on parameters

c#winformscrystal-reportssql-server-express

提问by izokurew

When printing a report, the user sometimehave the following error:

打印报告时,用户有时会出现以下错误:

CrystalDecisions.CrystalReports.Engine.LogOnException:  
Error in File C:\DOCUME~1\carolec\LOCALS~1\Temp\temp_b117cc2e-c184-4556-a493-e04e6d4126fb {388C2B55-114E-4087-A22D-9289902AFDEB}.rpt:  
Unable to connect: incorrect log on parameters. ---> System.Runtime.InteropServices.COMException (0x8004100F): 
Error in File C:\DOCUME~1\carolec\LOCALS~1\Temp\temp_b117cc2e-c184-4556-a493-e04e6d4126fb {388C2B55-114E-4087-A22D-9289902AFDEB}.rpt:
Unable to connect: incorrect log on parameters.
   à CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.GetLastPageNumber(RequestContext pRequestContext)
   à CrystalDecisions.ReportSource.EromReportSourceBase.GetLastPageNumber(ReportPageRequestContext reqContext)
   --- Fin de la trace de la pile d'exception interne ---
   à CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
   à CrystalDecisions.ReportSource.EromReportSourceBase.GetLastPageNumber(ReportPageRequestContext reqContext)
   à CrystalDecisions.CrystalReports.Engine.FormatEngine.PrintToPrinter(Int32 nCopies, Boolean collated, Int32 startPageN, Int32 endPageN)
   à CrystalDecisions.CrystalReports.Engine.ReportDocument.PrintToPrinter(Int32 nCopies, Boolean collated, Int32 startPageN, Int32 endPageN)

Any ideas on a solution?

关于解决方案的任何想法?

Configuration: C# (2008), WinForm, Crystal Report 10, SQL Server 2008 Express (local)

配置:C#(2008)、WinForm、Crystal Report 10、SQL Server 2008 Express(本地)

采纳答案by Phill

Haven't used Crystal Reports for a bit, but generally an error along the lines of "LogOn Exception" may actually have nothing to do with security at all, Crystal Report errors can be a bit random.

有一段时间没有使用过 Crystal Reports,但通常“登录异常”之类的错误实际上可能与安全无关,Crystal Report 错误可能有点随机。

Its possible it may be an error related to memory issues.

可能是与内存问题相关的错误。

Or...

或者...

It might be report specific, a sub-report maybe trying to logon using credentials stored within the report, rather than the credentials you've passed into it via the code; You need to loop through all sub-reports rather than just the main report setting the login information.

它可能是特定于报告的,子报告可能会尝试使用存储在报告中的凭据而不是您通过代码传递给它的凭据登录;您需要遍历所有子报告,而不仅仅是设置登录信息的主报告。

I remember having this particular error when I used a workaround to install a dynamic logo for a report (that got pulled from a binary field within another database table) except there was a slight error in which it pulled the logo data for each row of data; After a certain amounts of rows returned it died resulting in a similar error.

我记得当我使用一种变通方法为报告安装动态徽标(从另一个数据库表中的二进制字段中提取)时遇到了这个特定错误,但在为每行数据提取徽标数据时出现了轻微错误; 在返回一定数量的行后,它死了,导致了类似的错误。

回答by Arshad Mohammad

For anyone having the same problem, also check if your report's Datasource provider is "SQL Native Client". If yes, this wont work in your Production server which doesn't have SQL client installed. It has to be "SQLOLEDB" for it work in machines where there is no SQL client installed.

对于遇到相同问题的任何人,还请检查您的报告的数据源提供程序是否为“SQL Native Client”。如果是,这在没有安装 SQL 客户端的生产服务器中将不起作用。它必须是“SQLOLEDB”,因为它可以在没有安装 SQL 客户端的机器上工作。

This was the reason why my report worked on my test server(which had SQL server client) and did not work in my production server

这就是为什么我的报告在我的测试服务器(有 SQL 服务器客户端)上工作而在我的生产服务器上不起作用的原因

回答by khamami

I have same problem but has solved.

我有同样的问题,但已经解决了。

The problem is in odbc connection. Just install SQL native driver to add connection in odbc. Download link https://support.fotoware.com/hc/en-us/articles/208664385-Microsoft-SQL-Native-Client-fails-to-download-during-FotoWeb-setup

问题出在 odbc 连接中。只需安装 SQL 本机驱动程序即可在 odbc 中添加连接。下载链接 https://support.fotoware.com/hc/en-us/articles/208664385-Microsoft-SQL-Native-Client-fails-to-download-during-FotoWeb-setup

回答by Anthony Griggs

If you have had a report that used to work fine, but then suddenly stopped working... AND you are using SQL Server Authentication... check your Password Expiration date on the Login Account. :)

如果您有一份过去工作正常的报告,但突然停止工作……并且您正在使用 SQL Server 身份验证……请检查登录帐户上的密码到期日期。:)