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!

VB & Crystal: Does it being executed the query twice?

Status
Not open for further replies.

jescobedo

IS-IT--Management
Jan 19, 2004
15
0
0
MX
Hi everybody!

First of all, sorry for my english.

I run the program step by step to see where is the problem, but there is something that I don't understand.
The thing is, when the Record Set is open takes a long time to process because the complexity of the query, but at the moment of the preview (CRViewer1.ViewReport) I think the query is processed again because is taking long time too.

Could someone tell me is this is Ok, or what can I do to improve this?

This is the source code:

Set adoRS = New ADODB.Recordset

' ******** Here the Oracle connection is made *******
adoRS.Open gstrSQL, gcnOracle, adOpenForwardOnly,
adLockReadOnly, adCmdText

Set crRep_RotaBod = New cr_RotaBod
crRep_RotaBod.ParameterFields(1).AddCurrentValue gstrParameter1
crRep_RotaBod.ParameterFields(3).AddCurrentValue gstrParameter3
crRep_RotaBod.ParameterFields(2).AddCurrentValue gstrParameter4
crRep_RotaBod.Database.SetDataSource adoRS
CRViewer1.ReportSource = crRep_RotaBod


'*** Here the preview is made, and I supouse the query is being re-executed***

CRViewer1.ViewReport

Thanks
 
Is there anything in the report's Record Selcection Formula? If so, that would cause the report to filter the records again, even though you've presumably done so in the recordset.

You could also try forcing a ReadRecords:
[tt]
crRep_RotaBod.Database.SetDataSource adoRS
[tt]crRep_RotaBod.ReadRecords[/tt]
CRViewer1.ReportSource = crRep_RotaBod
[/tt]

-dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top