Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 SQL server and asp

Author  Topic 

BeamBrain
Starting Member

10 Posts

Posted - 2008-04-22 : 13:24:23
I have an application written in classic asp which connects to a sql server 2005 db.

I have 2 procs to open and close the db as follows

Code: ( text )
Dim strConn
Dim oConn

sub OpenDataConnection()
set oConn = CreateObject("ADODB.Connection")
strConn = "Provider=SQLOLEDB; Data Source = xxx; Initial Catalog = xxx; User Id = xxx; Password=xxx"
oConn.Open strConn
end sub


sub CloseDataConnection()
oConn.Close
set oConn = nothing
end sub


I'm trying to understand the difference between doing this...

OpenDataConnection()
set rsID = CreateObject("ADODB.recordset")
searchPhrase = "SELECT blah"
rsID.Open searchPhrase, strConn
rsID.close
CloseDataConnection()

and this...

OpenDataConnection()
set rsID = CreateObject("ADODB.recordset")
searchPhrase = "SELECT blah"
rsID.Open searchPhrase, oConn
rsID.close
CloseDataConnection()

i.e. using oConn instead of strConn. I've just changed everything to oConn from strConn but site performance seems to have dropped off considerably. fyi, i'm also trying to make the best use of connection pooling but this may not be relevant here.


tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-04-22 : 13:43:44
Since this isn't a SQL Server question, I'm moving your post to the ASP forum.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -