Discussion Locked

Intranet Web based Reports

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am developing an Intranet web based Reporting system using ASP
1.Is there any eficient way to open a database connection as I am opening and closing ADO Connection Object in each and every individual ASP Page as I have more than 100 reports andby an average I am using more than 400 - 500 ASP pages.

5 replies

by jim.schromm

You can set up a central asp file which contains the connection information and then reference that connection file in each asp page. For example: Create a file conn.asp which contains the line <%Conn_STRING = "dsn=sampledsn;uid=sa;password=junk"
%>

Then your pages would need the line at the beginning and the line something.ActiveConnection = Conn_STRING

by amwalsh

In the global.asa set a session variable to the connection string in the Session_OnStart sub. Ex:

Sub Session_OnStart
Session("ConnectionString") = "your connection string"
End Sub

You could also make it an Application variable in the Applicatoin_OnStart. The drawback to application variables is that the site must be stopped and restarted for changes to take.

If the site will get a lot of traffic, you should set up MTS (NT) or COM+ (2000) to manage the object pooling.

This discussion is closed to new replies.