Attempting to connect to SQL Server through Crystal Reports

16,738

When you get a "Database Vendor Code" error, this means that the error code was passed back from the database. So, we know this is a SQL Server error, not a Crystal error.

I found this post quite interesting, so I started researching what other people had to say regarding this subject matter. I stumbled upon this blog which seems to be a few years old. But, this talks about the Native Error: 18456 (which is the exact error code you are getting). So, I am hoping that if you try to create a udf file like the article suggests. You might end up getting something out of it. Here is the link to the article:

Crystal Reports Generating SQL Server Error 18456 Severity 8 Error Logs

Share:
16,738
Pat
Author by

Pat

Updated on July 13, 2022

Comments

  • Pat
    Pat almost 2 years

    I am attempting to connect Crystal reports to a SQL Server database. Here is what I have done so far.

    File > Log On or Off Server

    Create New Connection > OLE DB (ADO)

    Under provider I selected Microsoft OLE DB Provider for SQL Server and click next.

    I select the server from the drop down list and put in the username and password for the local admin account. I am able to remote to the server using this account. For the database field I have tried to enter the database name and the path to the .mdf for this database. I get the same error either way.

    Login failed.
    Details: ADO Error Code: 0x80040e4d
    Source: Microsoft OLE DB Provider for SQL Server
    Description: Login failed for user 'server\admin'.
    SQL State: 42000
    Native Error: 18456 [Database Vendor Code: 18456 ]
    

    Crystal Reports version: 14.0.4.738 RTM
    SQL Server 2012

    I did find some similar error messages through google, but the situations were different, so it was not helpful.

    • Hiten004
      Hiten004 about 9 years
      Please use SQL native client for MSSQL 2012. Download drive from here microsoft.com/en-us/download/details.aspx?id=29065
    • Pat
      Pat about 9 years
      What will this do for me? Do I need to install it on my machine or the server?
    • XtremeBytes
      XtremeBytes about 9 years
      Are you using windows authentication? Why does the login id has a domain like prefix?
    • Pat
      Pat about 9 years
      I am using windows authentication. The ID has the prefix because it is a local account rather than a domain account. I have tried both with and without the prefix and got the same error.
    • jjj
      jjj about 9 years
      Are you trying to remotely connect to a LocalDB database (*.mdf) from one maching to another machine? I don't think that what it's designed for.
    • Hiten004
      Hiten004 about 9 years
      Its a new driver for the 2012 sql server. you do not have to use old Microsoft OLE DB Provider.
    • Pat
      Pat about 9 years
      @jjj I didn't think so, which is why I tried the DB name first, but that did not work, so I tried putting the path to the file in the database field.
    • Pat
      Pat about 9 years
      @Hiten004 So, that should show up under Create New Connection after I install it?
    • jjj
      jjj about 9 years
      SQL Server Native Client should show up in the list of OLE DB (ADO) providers. If the .mdf file was already attached to a LocalDB instance, you'd be able to connect to it by setting the server to something like (localdb)\v11.0 and checking the Integrated Security box, but that's only from the same computer as the file (usually).
    • Pat
      Pat about 9 years
      @jjj I already have that installed and that is what I was trying to use. The computer that I am using crystal on is not the same computer that is the SQL server.
    • FutbolFan
      FutbolFan about 9 years
      Do you have CONNECT permissions for the server\admin? I don't think your issue is with the driver. It has most likely to do with the permissions/authorization.
  • Pat
    Pat about 9 years
    The user is already added to the SQL server. I can log in to SQL Server Management Studio with that account using windows auth.