Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8908

Get error when passing a server name to Crystal Report

$
0
0

I am developing a desktop application using VS 2012 with CRforVS_13_0_9 and CRRuntime_64bit_13_0_10 installed.  The database is SQL Server 2012 Express.  I use SQL OLEDB in Crystal Report to connect the SQL database.  Here is part of the codes.

 

   

Dim crTableLogoninfo As New TableLogOnInfo
    Dim crConnectionInfo As New ConnectionInfo
    Dim crTables As Tables
    Dim crTable As Table

 

    With crConnectionInfo
       

.ServerName = Login.sServer

        .DatabaseName = Login.sDatabase
        .UserID = Login.sDBUserID
        .Password = Login.sDBPassword
    End With

 

    Try
        crTables = CReport.Database.Tables
        For Each crTable In crTables
            crTableLogoninfo = crTable.LogOnInfo
            crTableLogoninfo.ConnectionInfo = crConnectionInfo
            crTable.ApplyLogOnInfo(crTableLogoninfo)
        Next
        CrystalReportViewer1.ReportSource = Nothing
        CrystalReportViewer1.ReportSource = CReport

 

 

I get an error "Failed to open connection -- Database vendor code 17" when I run a Crystal Reports through my application.  The problem is Crystal Reports does not like the server name which is passed.  The purpose for passing a server name is to connect to different server if needed.  I am not 100% sure the error occurs after VS 2012 or SQL Server 2012 express was updated.

 

Any ideas how I can fix this problem?

 

Thanks,

 

John


Viewing all articles
Browse latest Browse all 8908

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>