SAP Knowledge Base Article - Public

1610049 - Error: 'Data source object is not valid' after setting an ADODB.Recordset on SetDataSource method

Symptom

  • Using the code:
Dim rsPkLst As ADODB.Recordset = Nothing
Dim report As New crPickingList
...
' Fill ADODB.Recordset with SQL Statment
...
If rsPkLst.RecordCount > 0 Then
      report.SetDataSource(rsPkLst) ' Error : The data source object is invalid
EndIf
...
  • On development computer the code works as expected
  • When the application is deployed to a client computer, the following error is thrown:

Data source object is not valid

Environment

  • VS2010
  • CRVS2010

Cause

  • Using the Modules utility and comparing the differences, showed that the ADODB.DLL was missing on the client side

Resolution

  • Ensure that ADODB.dll is part of the installed runtime

See Also

  • Recommendation for VS .NET application is to use the ADO .NET Datasets
  • See Crystal Reports Guide To ADO.NET for more information
  • Use an OleDbDataAdapter.Fill() method to convert a RecordSet to a DataSet:
OleDbDataAdapter myDA = new OleDbDataAdapter();
DataSet myDS = New DataSet();
myDA.Fill(myDS, adoRS, "MyTable");

Keywords

CR2010 2010 CR4VS2010 CR4VS VS2010 NET2010 crystal reports for visual studio 2010 crforvs 13 , KBA , BI-DEV-NET-SDK , .NET SDK / COM SDK , How To

Product

Crystal Reports 2008 V1 ; SAP Crystal Reports, developer version for Microsoft Visual Studio