Crystal reports database login failed error

Posted on 2011-09-13
Medium Priority
Last Modified: 2012-05-12
HI, I am using multiple crystal reports in my website and yesterday I just added two new ones.  These new ones are using the exact same connection info as the previous reports.

When I make changes to my website the changes are first published to a test server, tested and then published to my production server.  When I run my reports on the test server the reports work fine; however when I run the reports from my production server I get a 'Database logon failed' error.

I have included the code from the page where I run one of the reports. I am disabling the database prompt and automatically populating this in the backend code. In all of my previous reports I only had to specify the username and password.  I tried adding the db server and database to the code for the new reports and I still get the same error.

<%@ Page Title="DSI Marketing System" Language="vb" AutoEventWireup="false" MasterPageFile="~/Styles/Reports.Master" CodeBehind="AwardedProjectsReport.aspx.vb" Inherits="MarketingSystem.AwardedProjectsReport" %>
<%@ Register assembly="CrystalDecisions.Web, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" namespace="CrystalDecisions.Web" tagprefix="CR" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderHeading" runat="server">
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderBody" runat="server">

<asp:Button ID="btnreports" runat="server" CssClass="button" Text="Back To Reports" />

    <CR:CrystalReportSource ID="CrystalReportSource1" runat="server">
     <Report FileName="Awarded Projects Report.rpt">
     <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" 
        AutoDataBind="true" EnableDatabaseLogonPrompt="False" EnableParameterPrompt="True"
        ReportSourceID="CrystalReportSource1" ReuseParameterValuesOnRefresh="True" DisplayGroupTree="False" />


Backend code:
Public Partial Class AwardedProjectsReport
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub
    Protected Sub CrystalReportSource1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles CrystalReportSource1.Load
        CrystalReportSource1.ReportDocument.SetDatabaseLogon("username", "password", "dbserver", "databasename")

    End Sub

    Protected Sub btnreports_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnreports.Click
    End Sub
End Class

Open in new window

Question by:imstac73
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 16

Expert Comment

by:Bryan Butler
ID: 36529914
Can you compare the working ones from production to the new ones?  There should be a difference that's causing this.  What version of crystal?  Are you creating these through the GUI or strictly coding?  Also check you path specifications.  You may need to use complete paths in the XML.
LVL 101

Expert Comment

ID: 36529962
Are these using a different set of tables/views/SPs from previous reports?
Perhps the user needs permissions to the tables/views/SPs these reports use


Author Comment

ID: 36530459
Using Crystal Reports XI R2.  I compared the reports and they are using the same connection and are set up the same way.  

mlmcc:  If it was a permissions issue I wouldn't think that it would work on my dev server either because I am using sql user credentials.
Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

LVL 101

Expert Comment

ID: 36530863
Is this a thick or thin client application?

Thick client applications run using the logged in Windows user.
Thin clients usually run with a system user.  The system user may be different on each server.


Author Comment

ID: 36531055
mlmcc...not sure what you mean by that.  I don't handle the administration of the web server.

I think the problem was that I was using a different data provider so I changed my new reports to match the other reports; however now when I try to build my solution I get a "Warning      2      Found conflicts between different versions of the same dependent assembly.      MarketingSystem" message and it will not let me build.

My version of Crystal Reports is full version, developer version and my assembly version listed in my web.config file is  Do I need to update the CR references in my solution?
LVL 101

Expert Comment

ID: 36531809
Sounds like it.


Accepted Solution

imstac73 earned 0 total points
ID: 36719330
The problem was that I was using SQL Server Native Client for my connection and my production server was not set up to handler using this connection type.  I changed my connection to oledb for sql server and it worked after that.

Author Closing Comment

ID: 36902275
Resolved it myself

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question