Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 question about asp connections
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

e3stone
Average Member

USA
885 Posts

Posted - 19 April 2001 :  18:08:37  Show Profile  Send e3stone an AOL message
I'm quite new at ASP and was wonder what, exactly, the following statement does:
quote:
<%
strSql = "select * from links_categories order by cat_name"
dim rsCategories
set rsCategories = server.CreateObject("adodb.recordset")
rsCategories.Open strSql, my_Conn
%>


does the last line just open the created recordset using the "my_Conn" database connection or does it open another instance of "my_Conn"? Well, to be more clear, should I only have to close "my_Conn" in the inc_footer.asp ? I just wanted to make sure I'm not creating multiple connection to the database and not closing them.

From what I can see, all the mods are just creating different recordsets and not connections. Is this true? Any help would be greatly appreciated. thanks

Eric

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 19 April 2001 :  18:43:54  Show Profile  Visit HuwR's Homepage
if you look at the forum inc_top you will see the connection is opened there, and is then closed in inc_footer

Your assumption is correct, they just create a new recordset using that pages connection. Also, some people are not aware, but if you do not put my_conn.close, IIS automatically closes the connection when it finishes processing the page.

Go to Top of Page

e3stone
Average Member

USA
885 Posts

Posted - 19 April 2001 :  19:08:12  Show Profile  Send e3stone an AOL message
ahhh, ok. I wasn't aware of that IIS feature, either. Thanks for clearing that up.

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.24 seconds. Powered By: Snitz Forums 2000 Version 3.4.07