Author |
Topic |
|
e3stone
Average Member
USA
885 Posts |
Posted - 19 April 2001 : 18:08:37
|
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
|
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.
|
|
|
e3stone
Average Member
USA
885 Posts |
Posted - 19 April 2001 : 19:08:12
|
ahhh, ok. I wasn't aware of that IIS feature, either. Thanks for clearing that up.
|
|
|
|
Topic |
|
|
|