disconnect from database server 
Author Message
 disconnect from database server

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



Fri, 26 Aug 2005 22:34:18 GMT  
 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



Mon, 29 Aug 2005 11:35:33 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Detecting disconnected Terminal Server Client

2. Web Server Disconnect

3. Disconnect Users from Servers Connected Resources?

4. I need help disconnecting fro SQL Server....

5. Winsock: How does client tell server it is disconnecting

6. VB server to return a disconnected recordset

7. disconnecting DAO-ODBC Connection to SQL Server

8. Disconnected RS from SQL Server

9. Udate SQL server using disconnected recordsets

10. Udate SQL server using disconnected recordsets

11. Help! Disconnected recordsets ADO and SQL Server

12. Disconnecting from server

 

 
Powered by phpBB® Forum Software