Ask a Question related to ASP Database, Design and Development.
-
zorro #1
Do I have to close connections or does it makes no difference?
Hello there,
Am I right in thinking all connections to a database have to be closed
and objects set to nothing? I'm finishing up a web site in ASP someone
else started and most pages have this type of code:
=========
dim conn
set conn = server.createobject("adodb.connection")
conn.connectionstring ="Provider=Microsoft.Jet.OLEDB.4.0;Persist
Security Info=False;Data Source=" &
server.MapPath("../../../db/db_saad.mdb")
conn.open
set rs = conn.execute("SELECT * FROM X)
==========
But those pages have none of these:
conn.close
set conn = nothing
rs.close
set rs = nothing
Should I add this code?
And what if there's a redirect before this code?
zorro Guest
-
Connections don't close in ie 6.0
At our company we have built a video/chat application with multiple rooms and a lobby using FMS2. The application runs fine in most browsers but... -
#39457 [NEW]: Multiple invoked OO connections never close
From: josh at mykoala dot com Operating system: OS X 10.4.8 PHP version: 5.2.0 PHP Bug Type: MySQLi related Bug description:... -
close my project that is in a browser window (close this window)
How can I do this with a button? What do I have to put into button? -
close ALL connections
is there a way to close all open database connections without referring to each connection by name across an entire server? mark -
perlcc makes it big
I'm running perl 5.8.0 on linux. I wrote a very simple program: #!/usr/bin/perl print "test"; that's it! and ran perlcc. it gave me an... -
Rob Collyer #2
Re: Do I have to close connections or does it makes no difference?
Hi...
It's considered very good coding practice to close all connections as soon
as you no longer need them.
Also, set all object references to nothing as soon as you are done with them
too.
All object references however are destroyed when the page has finished
execution.
Hope this helps.
--
Rob Collyer - [url]www.webforumz.com[/url]
Web design and development forums for Free help, advice,
tips, and website critique by professional designers and developers.
"zorro" <myahact@yahoo.ca> wrote in message
news:1baa8f0d.0407181013.614f4f66@posting.google.c om...> Hello there,
>
> Am I right in thinking all connections to a database have to be closed
> and objects set to nothing? I'm finishing up a web site in ASP someone
> else started and most pages have this type of code:
>
> =========
> dim conn
>
> set conn = server.createobject("adodb.connection")
>
> conn.connectionstring ="Provider=Microsoft.Jet.OLEDB.4.0;Persist
> Security Info=False;Data Source=" &
> server.MapPath("../../../db/db_saad.mdb")
>
> conn.open
>
> set rs = conn.execute("SELECT * FROM X)
>
> ==========
>
> But those pages have none of these:
>
> conn.close
> set conn = nothing
> rs.close
> set rs = nothing
>
>
> Should I add this code?
> And what if there's a redirect before this code?
Rob Collyer Guest
-
Jeff Cochran #3
Re: Do I have to close connections or does it makes no difference?
On 18 Jul 2004 11:13:04 -0700, [email]myahact@yahoo.ca[/email] (zorro) wrote:
Have to be? No. Should be? Definite yes.>Hello there,
>
>Am I right in thinking all connections to a database have to be closed
>and objects set to nothing?
Connections close and objects are destroyed when the page closes, but
you have no control over that event happening so close connections and
destroy objects as soon as you no longer need them.
Yes>I'm finishing up a web site in ASP someone
>else started and most pages have this type of code:
>
>=========
>dim conn
>
>set conn = server.createobject("adodb.connection")
>
>conn.connectionstring ="Provider=Microsoft.Jet.OLEDB.4.0;Persist
>Security Info=False;Data Source=" &
>server.MapPath("../../../db/db_saad.mdb")
>
>conn.open
>
>set rs = conn.execute("SELECT * FROM X)
>
>==========
>
>But those pages have none of these:
>
>conn.close
>set conn = nothing
>rs.close
>set rs = nothing
>
>
>Should I add this code?
Redirect after you close. Call it as a sub, or drop through to it>And what if there's a redirect before this code?
with a redirect after.
Jeff
Jeff Cochran Guest



Reply With Quote

