零星的水晶ADO错误 [英] Sporadic Crystal ADO Error

查看:73
本文介绍了零星的水晶ADO错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ASP.Net应用程序,其中包含Crystal Reports for Visual Studio 2005报告,该报告大部分时间都有效,然后突然停止工作一段时间。它会突然重新开始工作。



它会抛出以下错误消息并在网页中显示:(我用XXXX替换了真实用户)



"登录失败。详细信息:ADO错误代码:0x源:用于SQL Server的Microsoft OLE DB提供程序说明:用户XXXX登录失败。 SQL状态:42000本机错误:登录失败。详细信息:ADO错误代码:0x源:用于SQL Server的Microsoft OLE DB提供程序说明:无效的连接字符串属性SQL状态:文件C中的01S00错误:\ WINDOWS \ TEMP \MoldWeightHistory {69183D65-BFAD-4AC5-9F8C-2F57C9D1589D } .rpt:无法连接:登录参数不正确。"



应用程序和sql正在运行同一台机器。



运行MS Server 2003 Enterprise Edition SP2的服务器


ASP.Net app是VS2005 SP1


Framework是2.0.50727


SQL Server版本是:" ; Microsoft SQL Server 2000 - 8.00.760(英特尔X86)2002年12月17日14:22:05版权所有(c)1988-2003 Microsoft Corporation在Windows NT 5.2上的标准版(Build 3790:Service Pack 2)
" / p>


有没有人碰到这个?

解决方案

好早上好!



我遇到了同样的问题,我使用了以下代码,我在另一个网站上找到了。我只添加了两个新行以使我的工作。



红色代码及其正上方的代码。


我希望这会有所帮助!




public static < font size = 2> void Sub_CrystalLogin(CrystalDecisions.CrystalReports.Engine。 ReportDocument rptReportDocument)


{


CrystalDecisions.CrystalReports.Engine。 数据库 dbCR = rptReportDocument.Database;


CrystalDecisions.CrystalReports.Engine。 Tables tblsCR = dbCR.Tables;


CrystalDecisions.Shared。 TableLogOnInfo tliCRTableLogonInfo;


CrystalDecisions.Shared。 ConnectionInfo conninfoCR = new CrystalDecisions.Shared。 ConnectionInfo ();


conninfoCR.DatabaseName = WebConfig .pCRDatabaseName_Str;


conninfoCR.ServerName = WebConfig < font size = 2> .pCRServerName_Str;


conninfoCR.UserID = WebConfig .pCRDatabaseUserName_Str;


conninfoCR.Password = WebConfig .pCRDatabasePassword_Str;


foreach (CrystalDecisions.CrystalReports.Engine。 tblCR in tblsCR)


{


tliCRTableLogonInfo = tblCR.LogOnInfo;


tliCRTableLogonInfo.ConnectionInfo = conninfoCR;


tblCR.ApplyLogOnInfo(tliCRTableLogonInfo);


tblCR.Location = conninfoCR.DatabaseName + < font size = 2>" .dbo。" + tblCR.Location.Substring(tblCR.Location.LastIndexOf( "。" )+ 1);


}

}


I have an ASP.Net app with a Crystal Reports for Visual Studio 2005 report that works most of the time and then suddenly stops working for a while. It will just as suddenly start working again.

 

It throws the following error message and displays it in the web page: (I replaced the real user with XXXX)

 

"Logon failed. Details: ADO Error Code: 0x Source: Microsoft OLE DB Provider for SQL Server Description: Login failed for user XXXX. SQL State: 42000 Native Error: Logon failed. Details: ADO Error Code: 0x Source: Microsoft OLE DB Provider for SQL Server Description: Invalid connection string attribute SQL State: 01S00 Error in File C:\WINDOWS\TEMP\MoldWeightHistory {69183D65-BFAD-4AC5-9F8C-2F57C9D1589D}.rpt: Unable to connect: incorrect log on parameters."

 

The application and sql are running on the same machine.

 

Server running MS Server 2003 Enterprise Edition SP2

ASP.Net app is VS2005 SP1

Framework is 2.0.50727

SQL Server version is : "Microsoft SQL Server  2000 - 8.00.760 (Intel X86)   Dec 17 2002 14:22:05   Copyright (c) 1988-2003 Microsoft Corporation  Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 2)
"

 

Has anyone run into this?

解决方案

Good morning!

 

I was having the same problem you are and I used the following code i found on another web site. I only added two new lines in order to get mine to work.

 

The code in Red and the line right above it.

I hope this helps!

 

public static void Sub_CrystalLogin(CrystalDecisions.CrystalReports.Engine.ReportDocument rptReportDocument)

{

CrystalDecisions.CrystalReports.Engine.Database dbCR = rptReportDocument.Database;

CrystalDecisions.CrystalReports.Engine.Tables tblsCR = dbCR.Tables;

CrystalDecisions.Shared.TableLogOnInfo tliCRTableLogonInfo;

CrystalDecisions.Shared.ConnectionInfo conninfoCR = new CrystalDecisions.Shared.ConnectionInfo();

conninfoCR.DatabaseName = WebConfig.pCRDatabaseName_Str;

conninfoCR.ServerName = WebConfig.pCRServerName_Str;

conninfoCR.UserID = WebConfig.pCRDatabaseUserName_Str;

conninfoCR.Password = WebConfig.pCRDatabasePassword_Str;

foreach (CrystalDecisions.CrystalReports.Engine.Table tblCR in tblsCR)

{

tliCRTableLogonInfo = tblCR.LogOnInfo;

tliCRTableLogonInfo.ConnectionInfo = conninfoCR;

tblCR.ApplyLogOnInfo(tliCRTableLogonInfo);

tblCR.Location = conninfoCR.DatabaseName + ".dbo." + tblCR.Location.Substring(tblCR.Location.LastIndexOf(".") + 1);

}

}


这篇关于零星的水晶ADO错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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