Print Page | Close Window

Unable to connect: incorrect log on parameters.

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=2177
Printed Date: 28 Apr 2024 at 5:48am


Topic: Unable to connect: incorrect log on parameters.
Posted By: vkcrystal
Subject: Unable to connect: incorrect log on parameters.
Date Posted: 29 Jan 2008 at 4:34pm
Hi guys,

I am using VS.NET2005 and Crystal 10. Reports work fine on my local machine but when i try to deploy to another server i get this message.
Any idea? Appreciate your help
Thanks
 

Logon failed.
Details: Error Code: 0x
Source: ADODB.Connection
Description: Provider cannot be found. It may not be properly installed.Error in File C:\WINDOWS\TEMP\Medea {75AF52CB-2B30-454F-9B58-539E0C3294B6}.rpt:
Unable to connect: incorrect log on parameters.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Logon failed.
Details: Error Code: 0x
Source: ADODB.Connection
Description: Provider cannot be found. It may not be properly installed.Error in File C:\WINDOWS\TEMP\Medea {75AF52CB-2B30-454F-9B58-539E0C3294B6}.rpt:
Unable to connect: incorrect log on parameters.

Source Error:


Line 58: CrTable.ApplyLogOnInfo(crtableLogoninfo)
Line 59:
Line 60: CrTable.Location = crConnectionInfo.DatabaseName & ".dbo." & CrTable.Location.Substring(CrTable.Location.LastIndexOf(".") + 1)
Line 61: Next
Line 62:


Source File: d:\inetpub\wwwroot\onboarding\pages\PrintReport.aspx.vb Line: 60

Stack Trace:


[COMException (0x8004100f): Logon failed.
Details: Error Code: 0x
Source: ADODB.Connection
Description: Provider cannot be found. It may not be properly installed.
Error in File C:\WINDOWS\TEMP\Medea {75AF52CB-2B30-454F-9B58-539E0C3294B6}.rpt:
Unable to connect: incorrect log on parameters.]
CrystalDecisions.ReportAppServer.Controllers.DatabaseControllerClass.SetTableLocation(ISCRTable CurTable, ISCRTable NewTable) +0
CrystalDecisions.CrystalReports.Engine.Table.set_Location(String value) +502
Pages_PrintReport.refreshCrystalReport() in d:\inetpub\wwwroot\onboarding\pages\PrintReport.aspx.vb:60
Pages_PrintReport.Page_Load(Object sender, EventArgs e) in d:\inetpub\wwwroot\onboarding\pages\PrintReport.aspx.vb:18
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436



Replies:
Posted By: BrianBischof
Date Posted: 29 Jan 2008 at 7:13pm
For CR 2005, they have a new method to simply logging it. It's SetDatabaseLogin(id, pw) and it's part of the ReportDocument class. Give it a try and see how it works.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: vkcrystal
Date Posted: 29 Jan 2008 at 7:35pm

Hi Brian,

Please see my code below. It was working fine on my local machine but doesn't work   on windows2003 server.

 Dim dbFunctions As New DatabaseUtilities

        Dim oRpt As ReportDocument

        oRpt = New ReportDocument

        Dim reportPath As String = Server.MapPath("Medea.rpt")

        oRpt.Load(reportPath)

 

        Dim ServerName As String = "MSDB08Q"

        Dim DatabaseName As String = "ONBOARD"

        Dim userIDName As String = "sa1"

        Dim pwdName As String = "pass234"

 

 

        Dim crConnectionInfo As New ConnectionInfo

        Dim CrTables As Tables

        Dim CrTable As Table

        Dim crtableLogoninfos As New TableLogOnInfo

        Dim crtableLogoninfo As New TableLogOnInfo

 

        Dim crParameterFieldDefinitions As CrystalDecisions.CrystalReports.Engine.ParameterFieldDefinitions

        Dim crParameterFieldDefinition As CrystalDecisions.CrystalReports.Engine.ParameterFieldDefinition

        Dim crParameterValues As New ParameterValues

        Dim crParameterDiscreteValue As New ParameterDiscreteValue

 

        With crConnectionInfo

            .ServerName = ServerName

            .DatabaseName = DatabaseName

            .UserID = userIDName

            .Password = pwdName

 

        End With

 

        CrTables = oRpt.Database.Tables

 

        For Each CrTable In CrTables

            crtableLogoninfo = CrTable.LogOnInfo

            crtableLogoninfo.ConnectionInfo = crConnectionInfo

            CrTable.ApplyLogOnInfo(crtableLogoninfo)

 

               CrTable.Location = crConnectionInfo.DatabaseName & ".dbo." & CrTable.Location.Substring(CrTable.Location.LastIndexOf(".") + 1)

        Next

 

 

        crParameterDiscreteValue.Value = Request.QueryString("id")

        crParameterFieldDefinitions = oRpt.DataDefinition.ParameterFields

        crParameterFieldDefinition = crParameterFieldDefinitions.Item("OBID")

        crParameterValues = crParameterFieldDefinition.CurrentValues

        crParameterValues.Add(crParameterDiscreteValue)

        crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)

 

        oRpt.PrintOptions.PaperOrientation = CrystalDecisions.[Shared].PaperOrientation.Landscape

        Dim oStream As New MemoryStream 'using System.IO

 

        If Request.QueryString("t") = "pdf" Then

            oStream = oRpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)

            Response.Clear()

            Response.Buffer = True

            Response.ContentType = "application/pdf" 'vnd.ms-word

            Response.BinaryWrite(oStream.ToArray())

            Response.End()

        Else

            oStream = oRpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.Excel)

            Response.Clear()

            Response.Buffer = True

            Response.ContentType = "application/vnd.ms-excel"

            Response.BinaryWrite(oStream.ToArray())

            Response.End()

        End If

 

       



Posted By: BrianBischof
Date Posted: 29 Jan 2008 at 8:11pm
Well, all your code looks clean (as it should since it does work on your local box). I would try removing the part where you set the .Location property. This isn't necessary in CR 2005 anymore and I wonder if maybe since you're assigning the table owner and all that with concatenation, maybe something is going wrong there. Just get rid of that line b/c it's not necessary anyway and see if that helps out at all.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: vkcrystal
Date Posted: 29 Jan 2008 at 9:02pm
Brian,
Thanks for your help, i get rid of that .location and  i am getting the error at exporting to PDF file.  Please see below.
 
 
 
Description: Provider cannot be found. It may not be properly installed.Error in File C:\WINDOWS\TEMP\Medea {E48953AA-F243-4F31-92B1-4CD4BCA4154F}.rpt:
Unable to connect: incorrect log on parameters.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Logon failed.
Details: Error Code: 0x
Source: ADODB.Connection
Description: Provider cannot be found. It may not be properly installed.Error in File C:\WINDOWS\TEMP\Medea {E48953AA-F243-4F31-92B1-4CD4BCA4154F}.rpt:
Unable to connect: incorrect log on parameters.

Source Error:

 
Line 72: 
Line 73:         If Request.QueryString("t") = "pdf" Then
Line 74:             oStream = oRpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)
Line 75:             Response.Clear()
Line 76:             Response.Buffer = True

 



Posted By: BrianBischof
Date Posted: 29 Jan 2008 at 9:34pm
I don't know. What about creating a dummy report and use the production server database as the original data source. Get that working and then go into debug mode and look at it's ConnectionInfo properties to see if anything looks different from what you are doing. Plus, I would try getting a preview of it on the web page working before doing the export. Start with the simple stuff before adding complexity. These are just things I would play around with if it were me. Something strange is going on in the background and it's a matter of tracking it down and having that "ah ha!" moment.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: BrianBischof
Date Posted: 29 Jan 2008 at 9:39pm
It says the provider can't be found. Maybe the database provider isn't installed on that server? Have other reports worked on the server, or is this the first one you are trying it with?

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: vkcrystal
Date Posted: 30 Jan 2008 at 12:01pm

Hi Brian,

This is the first report i am trying to deploy on Windows2003 server. It just works fine on my local machine, do you think something with the other Server that i am trying to deploy?  It is so weird that i am getting this error
Thanks


Posted By: BrianBischof
Date Posted: 30 Jan 2008 at 2:31pm
I wonder if it is a permissions problem as well. ASP.NET needs to have full r/w access over the temp folder with the anonymous account. This is a problem for many people when they get their first report up and running.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: vkcrystal
Date Posted: 31 Jan 2008 at 3:39pm
I changed the Provider in the Report from SQLNLCI to SQLOLEDB  It Works !!.   aaah... Thanks for your help though


Posted By: BrianBischof
Date Posted: 31 Jan 2008 at 4:27pm
Great. I knew you would track it down eventually. 

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: ashisahb
Date Posted: 06 Oct 2008 at 10:53pm
Guys....
 
i am having the same problem, the report is working fine on development server and throws following exception on production server :
 
CrystalReportFormatter Error in exporting file J:\GEF\GSL\ReportFramework\Outbox\ROA_Summary.xls and error is CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.
Details: Could not open the field definition file 'C:\WINDOWS\TEMP\roa.ttx'.
Error in File C:\WINDOWS\TEMP\{40EE75E2-EC55-4A25-B633-139885D769D8}.rpt:
Unable to connect: incorrect log on parameters. ---> System.Runtime.InteropServices.COMException (0x8004100F): Logon failed.
Details: Could not open the field definition file 'C:\WINDOWS\TEMP\roa.ttx'.
Error in File C:\WINDOWS\TEMP\{40EE75E2-EC55-4A25-B633-139885D769D8}.rpt:
Unable to connect: incorrect log on parameters.
   at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext)
   at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
   --- End of inner exception stack trace ---
   at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
   at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
   at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext)
   at CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestContext reqContext)
   at CrystalDecisions.CrystalReports.Engine.FormatEngine.Export()
   at CrystalDecisions.CrystalReports.Engine.ReportDocument.Export()
 
 


-------------
Regards,
Ashish


Posted By: ppdeec
Date Posted: 09 Dec 2009 at 1:50am
Thanks vkcrystal

I  Had the same problem you have mentioned and the way you solved your problem solved mine too..



-------------
--
Deepak Poolamadai
http://www.linkedin.com/in/deepakpoolamadai


Posted By: sem.live
Date Posted: 20 May 2010 at 6:44pm
i have the same problem with you, can you show the guide for change from SQL NCLI...
Thanks its very urgent.


-------------
God Bless You


Posted By: sem.live
Date Posted: 21 May 2010 at 2:45am
thanks all i was try and its work...

-------------
God Bless You


Posted By: fanan
Date Posted: 07 Jan 2011 at 1:05pm
what is the solution please provide me


Posted By: lifeforest
Date Posted: 03 Nov 2011 at 10:36am
Thanks so much http://www.crystalreportsbook.com/Forum/member_profile.asp?PF=3559&FID=10 - vkcrystal ! your last posting helped me with the same issue.



Print Page | Close Window