locked
System.Runtime.InteropServices.COMException (0x8004100F): Logon failed

    Question

  •  

    Hi,

     

    I have developed one windows application in VS2005 using C#. I am using Crystal Reports 10 to generate reports. It is working fine when I am connecting to SQL Server 2005. When I try to connect to SQL Server 2000 (OS Windows 2003), then also works fine. But when I connect to SQL server 2000 (OS Windows 2000 server), it displays below error while generating reports, whereas works fine with same credentials for the application to display data. That means, connection between server and the application is fine.

     

    An early response is highly appreciated.

     

    Thanks for your attention.

     

    ============CODE=================

    crConnectionInfo.ServerName = dbServerName;

    crConnectionInfo.DatabaseName = dbName;

    crConnectionInfo.UserID = userName;

    crConnectionInfo.Password = password;

     

    crDatabase = objReport.Database;

    foreach(Table tempTable in crDatabase.Tables)

    {

    crTableLogOnInfo = tempTable.LogOnInfo;

    crTableLogOnInfo.ConnectionInfo = crConnectionInfo;

    tempTable.ApplyLogOnInfo(crTableLogOnInfo);

    tempTable.Location = dbName+".dbo." + tempTable.Location.Substring(tempTable.Location.LastIndexOf(".") + 1);

    }

    crpViewer.ReportSource = objReport;

     

    ===========ERROR===========

    System.Runtime.InteropServices.COMException (0x8004100F): Logon failed.
    Details: ADO Error Code: 0x
    Source: Microsoft OLE DB Provider for SQL Server
    Description: [DBNETLIB][ConnectionOpen (Invalid Instance()).]Invalid connection.
    SQL State: 08001
    Native Error:
    Error in File C:\DOCUME~1\RGI-AD~1\LOCALS~1\Temp\1\temp_7ad2ae4c-e7a7-4047-af60-fe15e4013927 {E23589A0-8DA9-4883-8CDC-6E19C92F79CE}.rpt:
    Unable to connect: incorrect log on parameters.

    Monday, February 25, 2008 2:21 PM

All replies

  • I had the same problem. What could be causing it is the SQL Native Client not being present on the machine that runs the reports.

    The native client is on the SQL Server 2005 install CD, or you can get it here:
    http://download.microsoft.com/download/4/4/D/44DBDE61-B385-4FC2-A67D-48053B8F9FAD/sqlncli.msi
    http://www.microsoft.com/downloads/details.aspx?familyid=d09c1d60-a13c-4479-9b91-9e8b9d835cdc&displaylang=en

    Installing it before deploying my app fixed the problem for me.
    Tuesday, May 13, 2008 11:31 PM
  • I had the same problem and I've resolved it install the SQL Native Client.
    Thanks,
    Rinaldo
    Monday, April 27, 2009 9:12 AM
  • I had the same problem and installing the SQL Native Client worked. Thank you so much,

     

    Roberto

     

     

    Tuesday, January 11, 2011 5:14 PM
  • Hi Guys,

     

     I am still facing the same problem. I am using Oracle DB Actually. it is working fine in My Visual studio when I run it. but it is giving below error in test server. 

     My development Environemnt is in XP-SP2

     & Test server is Windows Server 2008 with Oracle 9i Client installed. I have recently converted .Net 2003 code to 2008, so these reprts were actually developed in 2003 & converted to 2008. :(

     please suggest me if I am missng anything.

    Logon failed.
    Details: ADO Error Code: 0x
    Source: Microsoft OLE DB Provider for Oracle
    Description: Error while trying to retrieve text for error ORA-01019

    Native Error: Error in File C:\Windows\TEMP\EODCSTAlert {FCC9CAB3-AAD6-4E2C-ABB3-9748CE4E16CA}.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: ADO Error Code: 0x
    Source: Microsoft OLE DB Provider for Oracle
    Description: Error while trying to retrieve text for error ORA-01019

    Native Error: Error in File C:\Windows\TEMP\EODCSTAlert {FCC9CAB3-AAD6-4E2C-ABB3-9748CE4E16CA}.rpt:
    Unable to connect: incorrect log on parameters.

    Saturday, January 29, 2011 8:33 PM