Crystal reports database login failed error

Posted on 2011-09-13
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
  • 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 100

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.
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

LVL 100

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 100

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit If you want to manage em…

770 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