cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal report for visual studio 2010 data source object is not valid error

Former Member
0 Kudos

Hello,

I receive an "data source object is not valid" error when I want to print one CR document after setting an ADODB.Recordset on SetDataSource method of my report.

On my developer station, this operation works without problem but on client station, I get this error.

The redistributable package for client is installed on client side (CRRuntime_32bit_13_0_1.msi).

Can someone help me?

Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Never seen that error before. Is it an error from CR, or(?). Can you post a screenshot of the error?

Start with comparing dlls; Use [Modules|https://smpdl.sap-ag.de/~sapidp/012002523100006252802008E/modules.zip] compare the dev box logs to the runtime box...

Ludek

Follow us on Twitter http://twitter.com/SAPCRNetSup

Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

Answers (4)

Answers (4)

Former Member
0 Kudos

Hello everybody,

After using "Module" and compare differences, I find that ADODB.DLL was missing on Client side.

I do not understand why SQL Statment with ADODB Recordset was running fine on both Client and Developer side and why I get error only when I try to assign my ADODB Recordset to Crystal Report on Client side but now it is working fine.

Thank you very much for your help.

David.

Former Member
0 Kudos

Thank's for your answers

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
...

This error appears during "report.SetDataSource(rsPkLst)" instruction.

ADODB drivers are already installed and my ADODB.Recordset is filled with good records.

This project is an updated project from Visual Studio 2003 to Visual studio 2010 and the old version was running fine.

Developer and client station runs under Windows XP SP3.

On developer side I install CRforVS_13_0_1 (BuildVersion=13.0.1.220.Cortez_CR4VS).

On client side I install CRRuntime_32bit_13_0_1.msi.

Both stations use Microsoft .Net Framework 4.

Move to ADO.NET is a solution but, for the moment, I do not have the time to change all applications from my company.

(I get this error from all application updated from VS 2003 to VS 2010 developed since 2005)

David.

former_member183750
Active Contributor
0 Kudos

If it works on one box, the only reason it does not on another box is environment. It most certainly is not code as pertains to the report. It may be code that generates the recordset...

Look at my 1st post and follow it - for starters anyhow...

- Ludek

former_member208657
Active Contributor
0 Kudos

I've been trying to test this today and have run into a few problems. But in my research I found that you can use an OleDbDataAdapter.Fill() method to convert a RecordSet to a DataSet. It is one line and may help you get around this issue without re-writing ALL your code.

Worth checking out, http://msdn.microsoft.com/en-us/library/aa720078(v=vs.71).aspx


OleDbDataAdapter myDA = new OleDbDataAdapter();
DataSet myDS = New DataSet();

myDA.Fill(myDS, adoRS, "MyTable");

0 Kudos

Hi David,

As Ludek and I both said, it works on your Dev PC so It's not your code.

Search for this Kbase: SAP Note [1553469 - How to enable Database logging in Crystal Reports for Visual Studio 2010|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333533353333333433363339%7D.do]

Enable logging on the runtime only PC and see what it's telling you. Do it on the DEV PC also to compare...

Thanks

Don

former_member208657
Active Contributor
0 Kudos

Maybe it's time to move to ADO.NET DataTable or DataSets?

0 Kudos

Sounds to me like you don't have the SQL Client installed or the ADODB.Recordset drivers installed.

What version of MS SQL Server are you using and if it's SQL 2008 do you have the Client installed from the SQL CD?

Don