We help IT Professionals succeed at work.

How to link a datareport to multiple recordsets?

capkirkie
capkirkie asked
on
I want to show information in a datareport coming from a relational database. I'm using multiple recordsets. For my Datareport to work I have to provide 1 datasource and 1 datamember. Is there a way to get information from multiple recordsets and still use 1 datasource and 1 datamember?
Comment
Watch Question

Commented:
If the fieldnames are the same then you can change the datamember of the report at runtime.


Load DataReport1
DataReport1.DataMember = "Command2"
DataReport1.Show vbModal
Unload DataReport1

D'Mzzl!
RoverM

Author

Commented:
Thanks, but that's not enough for me.
CERTIFIED EXPERT
Top Expert 2012

Commented:
The report can only use one recordset.  In other words, you will have to create a recordset from that database for the data report.

If you give us more inormation it is likely that we can give you more detailed help.

Anthony

Commented:
Why not?

Another way is changing the SQL of the Command.
CERTIFIED EXPERT
Top Expert 2012

Commented:
roverm

>> Why not? <<
Not sure if this was directed at me.  In case it was: I believe the questioner was attempting to put the data from more than one recordset at the same time in a report:

<quote>
Is there a way to get information from multiple recordsets and still use 1 datasource and 1 datamember?
</quote>

This is clearly not possible.  The datareport only accepts one recordset at a time.  If I misunderstood the question, please set me straight.

Anthony
Commented:
Hi Anthony!

Sorry, I should have been more specific: The remark wasn't meant about your comment, but from our StarTrek fan ;-):

>>Thanks, but that's not enough for me.

Of course, Anthony, you are correct, the datareport can use 1 recordset at the time.

I think it is only possible to do what caption Kirk wants is by using a different SQL statement each time a report is opened.

capkirkie:
Can you please elaborate what you want exactly ?

Do you mean multiple recordsets in 1 report at 1 time (instead of 1 at A time) ?

Like Anthony: If I misunderstood the question, please set me straight!

D'Mzzl!
RoverM

PS: Anthony, again sorry for the misunderstanding!
CERTIFIED EXPERT
Top Expert 2012

Commented:
roverm,

No problem.  I believe it was I who misunderstood.  I believe capkirkie is MIA.

Anthony

Commented:
MIA: Think so too ;-)

D'Mzzl!
RoverM

Author

Commented:
You understood the question right. New question: what does MIA stand for?

Commented:
missing in action

Thanks for the points!

Explore More ContentExplore courses, solutions, and other research materials related to this topic.