Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error: 'Unable to access first record'

Status
Not open for further replies.

mclosson

Programmer
Mar 19, 2001
24
CA
I am using the RDC for Crystal Reports 8.0 with VB6 (I am using an ADO connection). The error "Unable to access first record" occurs whenever I try to pass an empty recorset into the report as one of the tables.

Is there any way around this issue?

Thank you,
Mike
 
A recordset should be the ONLY table passed to the report. Any linking should be done by the application or the database.

Why would you pass an empty recordset? Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Thank you for the reply,

In using an active data connection, CR8 does not properly handle the SQL connection. I have to create .ttx files for each report or subreport in a single report design. These are files that CR8 uses in the background under normal circumstances. They are essentially templates for the field names and data types in a connection to the database. Further, using this method does not allow for more than one recorset to be used in a single report or subreport within a report design. In talking the Seagate customer help, I have been told this is the only solution to my problem. Hopefully they improve the use of SQL and ADO connections with CR in the future (CR8.5?)

My problem was that if one of the recordsets I was sending was empty, the program would not create a report at all and would show an error. I found that the p2smon.dll that installs with CR8 is the one for CR7. I updated it with the version 8 p2smon.dll and everything now works fine.

Thanks,
Mike
 
I have a similar setup as "mclosson" except I am trying to use multiple "ado"'s. I am trying to show tuples from a "parent" table (as the main recordset for the report) with all the associated child tuples in a different talbe.

Example.

States (ado1)-Cities(ado2)

Texas
Houston
Dallas
California
San Francisco
San Hose
Nevada
Los Vegas

How should I do this? A sub report or two ados?
 
One Report with fields from both tables, created with the active data option in CR or a ttx file.
One recordset with the same fields as the report.
Then pass the recordset to the report. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Well, normally I send only one table to a report via the Ado, but in this case I want to show the "1 to Many" relationship. Are you suggesting I send a table that looks like this....

(This is obviously not accurate data, just examples)

[state], [statebird],[State population],[city],[city pop]
Texas, crow, 1234412424, Houston, 23445
Texas, crow, 1234412424, Dallas, 6653
Texas, crow, 1234412424, Ft Worth, 45555
California, bluebird, 928374928, San Fransciso,5435
California, bluebird, 928374928, San Jose, 4355
etc....

Right?
 
Yes. That is how the results would look if you were connecting directly to the database using CR. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Could I use subreports? How do I bind reports at runtime? I can't seem to get a "SetDataSource" on a SubReportObject!

(The reason why I ask is because I want 5 or 6 sub tables in the report, and that would be one -HUGE- recordset)
 
You could use subreports, but that would be the hard way. A single report with a group by State is all you need. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Hey! That support URL really helped! it's working fantastically!

Thank you so much!

I'm using 7 subreports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top