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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SetDataSource, Recordsets and unbound reports

Status
Not open for further replies.

MrJC

Programmer
Jan 3, 2002
27
GB
Hi all,

Wondering if somebody could please advise on the following problem with Crystal (8) - I've spent a good while searching and although I've found plenty of responses which seem to be 'in the general area', there are none which fully address the problem that I've got.

I'm creating a set of crystal reports using the RDC within Visual Basic (6). The idea is that these reports are 'unbound' and I automatically bind data to them from a SQL query.

Everything works find using '.Database.AddADOCommand' - using a Command object. Now I've hit a point where I need to build up a custom (ADO) recordset and then bind that.

However - every variation that I've seen on using '.Database.SetDataSource' always generates error number 9, subscript out of range.

I'm assuming that this is due to the fact that the base report has no database or table associated with it - but everything works fine using the Command object.

Has anybody got this '.Database.SetDataSource' to work with an unbound report (not associated with any database) ? If so any pointers or suggestions would be gladly received !

Many thanks for any help

Jon
 
I am having the same problem. Were you able to resolve this?
 
Yep,

Sorted it. Literally just yesterday. Actually it was something somebody posted a while back (I honestly checked every message I could see before posting my orginal query, honest :)

Anyways - what you want to do is use the ADOCommand object to bind to Crystal (Database.AddADOCommand) that works. Instead of using a Command object however, you can bind an Recordset using:

Recordset.ActiveCommand

That will pass a usable Command object to Crystal - after you've generated the Recordset !

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top