none
Reporting Services (Express) cannot connect to a LocalDB data source

    Question

  • Hello All,

    I have SQL Server 2012 Express with Advanced Services installed. I can design, build, preview and deploy my report to http://mypc/ReportServer_SQLEXPRESS with no problem. However, when my ASP.NET 4.0 application tries to display the report (using the ReportViewer 10.0 web control)  in Remote mode, it times out and the ReportViewer control displays the following message:

    • "An error has occurred during report processing. (rsProcessingAborted)
      • Cannot create a connection to data source 'DataSource1'. (rsErrorOpeningConnection)
        • A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 50 - Local Database Runtime error occurred. Cannot create an automatic instance. See the Windows Application event log for error details. )"

    I can reproduce this message by using the "Test Connection" button in Report Manager/Data Sources, but the identical connection string works, as I said, when I am previewing in BIDS.

    The Windows application log shows:

    "Unexpected error occurred while trying to access the LocalDB instance registry configuration. See the Windows Application event log for error details." and
    "Windows API call OpenProcessToken returned error code: 5. Windows system error message is: Access is denied.
    Reported at line: 1460. "

    I suppose that the IIS account does not have permission to run SqlLocalDB.exe. What is the best way to fix this? Should I be using Express and not LocalDB?

    Saturday, November 02, 2013 10:01 PM

Answers

  • I have SQL Server 2012 Express with Advanced Services installed. ....  Should I be using Express and not LocalDB?

    Hello John,

    See Features Supported by Reporting Services in SQL Server Express =>

    "Report data sources must be SQL Server relational databases that run locally in SQL Server Express."

    You can only use the relation database of the same instance, you can not use an other engine, also not a LocalDB one.


    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    • Marked as answer by johnbrown105 Tuesday, November 12, 2013 11:57 AM
    Tuesday, November 12, 2013 8:29 AM

All replies

  • Hi

    From the error message "Cannot create a connection to data source 'DataSource1'. (rsErrorOpeningConnection)" we can know that the account on the client PC lack the permission to connect to the database. We can avoid this in two ways, the first one is grant the corresponding permission to the client account. Another one is that specify a single set of stored credentials. Stored credentials are used if the report runs unattended. The report server retrieves and uses the credentials when report processing is scheduled or triggered by an event rather than a user request. For more detail steps about how to set Store Credentials for a Data Source, please see: Store Credentials for a Data Source (Report Manager)

    Thanks

    Tuesday, November 12, 2013 8:03 AM
  • I have SQL Server 2012 Express with Advanced Services installed. ....  Should I be using Express and not LocalDB?

    Hello John,

    See Features Supported by Reporting Services in SQL Server Express =>

    "Report data sources must be SQL Server relational databases that run locally in SQL Server Express."

    You can only use the relation database of the same instance, you can not use an other engine, also not a LocalDB one.


    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    • Marked as answer by johnbrown105 Tuesday, November 12, 2013 11:57 AM
    Tuesday, November 12, 2013 8:29 AM
  • I have switched to Express, and all is well. Thanks.
    Tuesday, November 12, 2013 11:57 AM