Skip to Content
author's profile photo Former Member
Former Member

Occasional Database Login prompts

Post Author: Jon Webb

CA Forum: .NET

I'm have a problem with occasional logon info prompts when I refresh a report. I'm using Crystal Report .NET XIR2 with SQL Server Express. Normally, my reports work fine. The server and database are set dynamically at runtime. The code I use for this is: Protected Sub SetDatabaseConnection(ByVal rd As ReportDocument) Dim tlois As TableLogOnInfos = Me.CrystalReportViewer.LogOnInfo Dim ci As New ConnectionInfo ci.DatabaseName = DefaultDatabase ci.IntegratedSecurity = False ci.Password = Password ci.UserID = User ci.ServerName = DefaultInstance For Each tloi As TableLogOnInfo In tlois tloi.ConnectionInfo = ci Next If rd Is Nothing Then rd = Me.CrystalReportViewer.ReportSource For Each table As Table In rd.Database.Tables table.LogOnInfo.ConnectionInfo = ci table.ApplyLogOnInfo(table.LogOnInfo) Next For Each subreport As ReportDocument In rd.Subreports For Each table As Table In subreport.Database.Tables table.LogOnInfo.ConnectionInfo = ci table.ApplyLogOnInfo(table.LogOnInfo) Next Next End SubSometimes, however, I get Database Login prompts when I refresh the reports. This happens with some reports and not others, even though I call the same method above for all reports. The Database Login prompt has the right server name, user, and password, but the database name is blank.The behavior varies over time. Yesterday, for example, one of my reports was showing this behavior, and another wasn't. Today, without any code changes, I'm getting it in two reports. But a third report still works. All three reports use the same command for accessing the database data, and have the same subreport structure.Also, the behavior is client-dependent. I can run the report on one PC (using the same SQL Server) and the report works fine. On another client, I consistently get the login prompt with two reports but not another. I believe the problem only occurs where the server is remote. We've never seen it with a local SQL Server. All this leads me to think that something is happening behind the scenes with Crystal Reports. Perhaps the logon info is being cached somewhere and not reinitialized. I've tried rebooting my client machine and restarting the SQL Server to no avail. Does anyone have an idea what is going on here? This is a serious problem for some of our customers. Jon WebbPEP Systems, Inc.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 06:45 PM

    Post Author: Jon Webb

    CA Forum: .NET

    I got some more information on the login prompt. I somehow figured out how to turn on logging in Crystal Reports and got this error when the login prompt happened: <Log> <Message></Message> <File>.\crreportsource.cpp</File> <Line>303</Line> <Time>2008/01/29 13:43:26.184</Time> <ThreadID>01216</ThreadID> <DetailMessage><!&#91;CDATA&#91;Analysis Server: 0x8004100FDatabase logon failed.\servers\ras\dtsagent\reporthandler.cpp (9557)Analysis Server: 0x8004100F&#93;&#93;></DetailMessage></Log><Log> <Message></Message> <File>.\crreportsource.cpp</File> <Line>426</Line> <Time>2008/01/29 13:43:26.294</Time> <ThreadID>01216</ThreadID> <DetailMessage><!&#91;CDATA&#91;.\crreportsource.cpp (420)RptControllers.dll: 0x8004100FDatabase logon failed.Analysis Server: 0x8004100FDatabase logon failed.\servers\ras\dtsagent\reporthandler.cpp (9557)Analysis Server: 0x8004100F&#93;&#93;></DetailMessage></Log>Does that help? Anyone?Jon WebbPEP Systems, Inc.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.