Print Page | Close Window

Checking wheather all conections are cut

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=8865
Printed Date: 29 March 2026 at 3:54am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Checking wheather all conections are cut
Posted By: dj air
Subject: Checking wheather all conections are cut
Date Posted: 13 January 2004 at 5:16pm

hi guys,

does anyone know a script/code that can check that all connections to a database are closed ...... or command like abondon .....

in my script i am using the same sort of method as bruce ie adoCon.open to the db then using the strCon in the queryies..

and using

adoCon.Close
SET adoCon = Nothing
SET strCon = Nothing

but one of the script users has reported there are still connections .. i close all connections in the queryies ..... i think i do ..

is there away to see what connections they are..

am i missing something..




Replies:
Posted By: Mart
Date Posted: 13 January 2004 at 5:21pm
Do you mean like

If adoCon = Nothing
...
End If



Posted By: dj air
Date Posted: 13 January 2004 at 5:35pm

i mean i create connections .. below is a example of the script connection system... way i have done it

adoCon.open strCon

then say make a query

rsQuery.open strSQL , strCon

rsQuery.close

adoCon.Close
SET adoCon = Nothing
SET strCon = Nothing

that is what my script uses.....

the problem is one of the users has said that the script is still leaving connections to the database open ..

i was woundering if there was a script code that i can use to see what ones are being left open...

i dont want to use it in the script i want to use it to find the connections that are left open.... so i can fix those connections....

coz if i was goning to use

if AdoCon  = nothing then

END IF

i would have seen where the problem is ...



Posted By: dpyers
Date Posted: 13 January 2004 at 6:49pm

Sometimes and On Error routine or a conditional redirect will leave connections open. the rule of thumb is open late, close early. You may also want to check for places where you may have closed a connection, but not destroyed it. IIRC, connections from the pool to MSSQL time out after 60 seconds. Don't know about Access.

Tip from 4guysfromrolla may help...

http://www.4guysfromrolla.com/webtech/tips/t021000-1.shtml - http://www.4guysfromrolla.com/webtech/tips/t021000-1.shtml



-------------

Lead me not into temptation... I know the short cut, follow me.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net