Solved

Crystal reports database login failed error

Posted on 2011-09-13
8
687 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:imstac73
Comment Utility
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
Comment Utility
Sounds like it.

mlmcc
0
 

Accepted Solution

by:
imstac73 earned 0 total points
Comment Utility
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
Comment Utility
Resolved it myself
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now