
disconnect from database server
Jane,
This is not exactly an answer, but maybe something to consider.
What I do is collect the parameters from my Vb form, so I can have lookups
and calendars, then pass those to the SQL stored procedure which is returned
to a ADO recordset. Then with I set the report datasource to the Recorset
without any crystal selection criteria (CrRep.Database.SetDataSource
rsOutput, 3, 1).
This way my big bad SQL server does all the work and passes less data over
the wire back to me
Then I can destroy the rsOutput ADO.recordset and open my report.
In my experience with tables of 1 to 2 million records, on a pretty good PC,
I have not noticed any difference in performance if I close RSoutput before
I open the report.
Hope this was helpful or at least interesting.
Ayrin
Quote:
> Hello,
> I have developed an application with VB6, SQL Server 2000
> and Crystal Report 8.5. When the application starts, It
> opens a connection to database and all recordsets use this
> connection.But since reports take some parameters from
> screen, I use following code:
> crcReport.Connect = "Provider=SQLOLEDB;.."
> crcReport.SelectionFormula = "." (take parameter from
> user's input on the screen)
> My question is if I should disconnect from the server
> explicitly or it disconnected automatically after
> displayed the report (crcReport.Action=1)? If so, which
> method should I use?
> Same thing in using ADO data control, I have to
> use "adodc.ConnectionString = "Provider=SQLOLEDB.1;." to
> get data displayed. How should I handle the disconnection?
> I couldn't find any method to do disconnection for above
> situations.
> Any help will be greatly appreciated!
> Jane