Solved

Crystal reports database login failed error

Posted on 2011-09-13
8
692 Views
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>
<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">
        </Report>
    </CR:CrystalReportSource>
    
     <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" 
        AutoDataBind="true" EnableDatabaseLogonPrompt="False" EnableParameterPrompt="True"
        ReportSourceID="CrystalReportSource1" ReuseParameterValuesOnRefresh="True" DisplayGroupTree="False" />

</asp:Content>

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")

        CrystalReportViewer1.RefreshReport()
    End Sub

    Protected Sub btnreports_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnreports.Click
        Response.Redirect("EstimateReports.aspx")
    End Sub
End Class

Open in new window

0
Comment
Question by:imstac73
  • 4
  • 3
8 Comments
 
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.
0
 
LVL 100

Expert Comment

by:mlmcc
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

mlmcc
0
 

Author Comment

by:imstac73
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.
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 100

Expert Comment

by:mlmcc
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.

mlmcc
0
 

Author Comment

by:imstac73
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 11.5.12.1838 and my assembly version listed in my web.config file is 11.5.3.7.  Do I need to update the CR references in my solution?
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 36531809
Sounds like it.

mlmcc
0
 

Accepted Solution

by:
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.
0
 

Author Closing Comment

by:imstac73
ID: 36902275
Resolved it myself
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

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. …
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…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

839 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