cancel
Showing results for 
Search instead for 
Did you mean: 

Error database vendor code 201: Error in File Temp_some random name.rpt

bonnyshroff
Member
0 Kudos

I have created the reports in database name test.

Now converting the database name to MainDb I get this error. I am using DSN for its datasource, changed the database in DSN. Still having the error. Have ODBC Connection.

Exception thrown: 'System.Runtime.InteropServices.COMException' in CrystalDecisions.CrystalReports.Engine.dll Additional information: Failed to retrieve data from the database. Details: [Database Vendor Code: 201 ] Failed to retrieve data from the database. Error in File temp_e955f2d3-92ca-4d4b-aca5-7aea52bea946 12472_10488_{00C8A76C-3FF2-4114-A1A7-8685B9B5F348}.rpt: Failed to retrieve data from the database. Details: [Database Vendor Code: 201 ]

My code below. Please help.
Private Sub DisplayReport()

        Try

     Dim report As New Summary
Dim pubdbname as String = "mainDb" -------This name is correct.
      With report
                .DataSourceConnections.Item(0).SetConnection("bonny", Pubdbname, True)
                .SetParameterValue("@CompYear", PubYear1)
                .SetParameterValue("@CompNo", mComp1)
                .SetParameterValue("@accode", PubAcCode)
               
                .SetParameterValue("@Trtype", PubTrTp)
                .SetParameterValue("@SBkCd", PubSBkCd)
   

                .SummaryInfo.ReportTitle = "Summary Report" & "_" & Format(CDate(FromDate.Text), "ddMMyyyy") & "-" & Format(CDate(ToDate.Text), "ddMMyyyy")
                CReports.CRViewer.ReportSource = orptname
                CReports.Show()
            End With
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
End Sub

Accepted Solutions (0)

Answers (0)