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

AddADOCommand

Status
Not open for further replies.

trc

MIS
Nov 27, 2000
126
0
0
CA
I just started to do app support for an app that has several reports in it. The reports are embedded in VB6.

One report keeps crashing and I believe it is because there are multiple org_id being passed to it via the following:
moReport.Database.AddADOCommand lrsDetail.ActiveConnection, lrsDetail.ActiveCommand

It crashes on this statement.
CRViewer1.ReportSource = moReport

There is no database on the report. I think that it is CR 8 that I am using. The database is Oracle 8.

I think that I need to either change the way that the information is sent to the report or the way that the report deals with the information sent to it. Since I am new I do not know which the best thing to do is.

I am trying to replicate the manner in which other reports are built but they are very different so it is difficult.

Can I pass a record set to the report if it has no DB on it? If so how?

Would it be better to rebuild the report?

************
My purpose in life is to show others what not to do.
<!--Caution, dates on calendar are closer then they appear.-->
 
Also, I have tried to use this code to no avail. I understand why the second one does not work but cause for the first one to not work is unclear.

moReport.Database.SetDataSource lrsDetail, 3
moReport.Database.Tables(1).SetDataSource lrsDetail, 3

************
My purpose in life is to show others what not to do.
<!--Caution, dates on calendar are closer then they appear.-->
 
Ok. So I fixed it. Here is what I now have. I am a little confused as to why it works as I seem to be sending the same information twice and it will not work with only one of the following. To make things even more strange, the SetDataSource command is malformed as the table is not specified.

If you can explain why it works I would greatly appreciate it.

moReport.Database.AddADOCommand lrsDetail.ActiveConnection, lrsDetail.ActiveCommand

moReport.Database.SetDataSource lrsDetail, 3


************
My purpose in life is to show others what not to do.
<!--Caution, dates on calendar are closer then they appear.-->
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top