cancel
Showing results for 
Search instead for 
Did you mean: 

SetDataSource not setting the data on some reports.

Former Member
0 Kudos

I am working with a VB6 app, and it uses Crystal Reports 8.5. It used to work when I had unbound fields on the reports, but my boss said we need to use bound data fields.

So I changed the reports to use bound data, but only some of the reports now work. The data being passed to the reports is in the form of a recordset. I have a check in place to make sure there are records to post, and for some reports, it acts as though no data was passed at all.

On some reports I get an error "Unable to access first record." Then it tells me "SQL Server Error." But I am using MS Access as the datasource, and I have checked to make sure that all the fields in the database have not changed in any way to what was used in design time.

Any help would be greatly appreciated.

Thanks,

Chris

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi, Chris;

We just have one instance of that error:

[Link|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233313334333533383337%7D.do]

When passing a Record set to a report, the report should have been created using a TTX file. See the following articles:

[TTX|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f008593a-9e1d-2b10-1692-f9966d876b6b]

[TTX2|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5050904e-911e-2b10-009f-b5c857d0c0d4]

Regards,

Jonathan

Former Member
0 Kudos

Thanks for your help, I will look into these possible solutions. I will come back to reply if i can get it working.

Thanks,

Chris

Answers (1)

Answers (1)

Former Member
0 Kudos

I have tried the options above, and still have the same problem. There seems to be only a problem with the sub reports that are not showing data. When i pass recordsets used for those reports to the reports that work, they show the data.

Think there might be something wrong with the sub reports, and i might have to try rebuilding the reports.

Thanks for the help though,

Chris

Former Member
0 Kudos

Hi, Chris;

If the subreports were made using a different database connection, that could explain the issue. If you open the report in the CR Designer, and choose Verify Database from the database menu, that may help.

Regards,

Jonathan

former_member183750
Active Contributor
0 Kudos

Also, try to save out a subreport and run it as a report in and of it's self. This simplifies the troubleshooting a bit.

Ludek

Former Member
0 Kudos

Jonathan,

I have already tried that. They are all designed using the same database, but I think maybe there was an issue with me not specifically creating the ADO connection on each report. (I just used the connection already created from previous reports. The main reason why I say this, is because the reports that work fine were all created with an ADO connection at design time. The ones that don't work were created using an ADO connection that was created using the reports that work.)

I have decided to just re-create the reports, specifically creating the ADO connection for each one. So far this is fixing my problem.

Thanks for all your help though,

Chris

Former Member
0 Kudos

Ludek,

I did actually try that, and it still did not work. But the reports were having no problem when I would preview them from Crystal Reports. It is just when they were used in VB6 they would house no data.

But as I stated earlier in a reply to Jonathan I will be just re-creating the reports from scratch (which should only take me a few hours), since tests have so far shown that it should fix the problem.

Thanks for your help,

Chris