Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 21st, 2004, 11:59 PM
SoC SoC is offline
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Default Closing db connections - when/how?

Howdy,

I've been getting constant errors with a web/database
application. I'm not sure what is causing them - whether it's
a problem with IIS 5 (service pack 2) or if it is my code.

When accessing the asp pages, I get an error code such as:

1. HTTP/1.1 New Application Failed

or

2. -2147417848 (0x80010108)

I am wondering if it is some sort of memory leak. I do close
off all the db connections, but I am wondering if the following code is the right way to do it, or whether it's the wrong way around or something. This is the last few lines of code of one of the pages:

</body>
</html>
<% if rsDirected.EOF and rsDirected.BOF then
Response.Redirect("error-page.asp")
end if%>
<%
rsDirected.Close()
Set rsDirected = Nothing
%>

Do I need to close the connection before the redirect?

What else could be causing these problems? Any help much appreciated.

Cheers,

S


Reply With Quote
  #2 (permalink)  
Old November 22nd, 2004, 12:21 AM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Have you Googled the error? there is alot of info on it?

Are you sure its IIS 5.0 you are using? If you are using IIS 4.0 MS say this may be the cause:
'The IUSR account is a domain account and is not being authenticated correctly against a domain controller.'
http://support.microsoft.com/kb/q210842/

I am aware of someone resolving this problem by rebooting the web server also

;;;Do I need to close the connection before the redirect?
Close your connections when you no longer need them. If you dont need a connection after the redirect then, yes I would.


Wind is your friend
Matt
Reply With Quote
  #3 (permalink)  
Old November 22nd, 2004, 12:34 AM
SoC SoC is offline
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Matt,

Yes, we're definitely using IIS 5. I have googled the errors, but there doesn't seem to be any definite answers. Some people say it's a coding error, others say it's an IIS thing. Also, global.asa files keep popping up as a possible cause. I don't actually use one for the app, but there is one in the root of the site - I think it's a FrontPage thing, because the website was initially established through FP.

The problems are always rectified temporarily by resetting the server.

Cheers, S

Reply With Quote
  #4 (permalink)  
Old November 22nd, 2004, 12:48 AM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

;;;I don't actually use one for the app, but there is one in the root of the site

If you are not using a global.asa there doesn’t need to be one there, I would remove it (better still just re-name it, this way you can eliminate it as a problem and always get it back). Yes, there is allot of talk about global.asa's regarding this error, IMO probably not the cause.

;;;I think it's a FrontPage thing
mmmmm. FP and DW put allot of un necessary code in pages, I don’t believe they would create a global.asa file without being told to.

Is it a production server? if not try rebooting it.


Wind is your friend
Matt
Reply With Quote
  #5 (permalink)  
Old November 22nd, 2004, 12:56 AM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Correction re-boot, no. Restart web services, yes

Are you using session variables? If so check sesisons are enabled


Wind is your friend
Matt
Reply With Quote
  #6 (permalink)  
Old November 22nd, 2004, 02:44 AM
SoC SoC is offline
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the help, Matt.

I'm not using session variables, but I am using some of DW's in-built server behaviours. I have suspected that these might be a bit of a problem. The code certainly is bloated.
Apparently we're moving to IIS 6 and Win2k3 soon. Maybe that will help.

Reply With Quote
  #7 (permalink)  
Old November 22nd, 2004, 06:31 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

You are welcome, is your problem resolved?

;;;DW's in-built server behaviours
I have never used DW but have worked with code that was created by it. wow it creates of unnecessary code, some of which Im still unsure what it does.


Wind is your friend
Matt
Reply With Quote
  #8 (permalink)  
Old November 22nd, 2004, 09:30 PM
SoC SoC is offline
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Unfortunately the problem isn't resolved yet. IIS was reset yesterday and everything worked fine for the rest of the day, but this morning I got another error. I can't make sense of it. It was working fine for about 4 weeks, while I was testing it heavily. In the last week it hasn't been used much, and it keeps falling over.

The error this morning was something like 'The remote procedure call failed and did not execute'. The other websites on the server then got the following error: 'The RPC server is unavailable'.

aaaaargh

Reply With Quote
  #9 (permalink)  
Old November 22nd, 2004, 09:41 PM
SoC SoC is offline
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Default

As you can probably tell, I'm pretty new to all this. I just wanted to clarify a question in my previous post:

Can you come to any conclusions given that the web application (it's just a simple document management system) was fine for all those weeks during heavy testing? Does this mean that it is not a coding error? Or does it mean that it probably is? It just seems strange that it would work perfectly for several weeks, being used by multiple people, then all of a sudden start dropping dead once a day.


Reply With Quote
  #10 (permalink)  
Old November 22nd, 2004, 10:18 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

;;;IIS was reset yesterday and everything worked fine for the rest of the day

How are you doing this? In the system services area? (right click my computer / manage / services)

;;;'The remote procedure call failed and did not execute'.

This error I get once in a blue moon. I believe it’s to do with a .dll calling and being called incorrectly, I never did get it sorted however as I said once in a blue moon. Does the site use any custom built/registered library files?

What is the code trying to do when you get this error, upload a file maybe? Post the code (and exact error details) you are running when this error rears its ugly head.

;;;Does this mean that it is not a coding error? Or does it mean that it probably is

If a page runs error free one day providing there have been no configuration/permission etc.. changed I would say the code is fine. But, if anybody knows your admin password you can not be sure no change has occurred.

Gone to lunch


Wind is your friend
Matt
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening & Closing Database connections pauliehaha Classic ASP Databases 4 December 18th, 2006 08:50 AM
closing connections - application pooling goingmad Classic ASP Databases 0 September 29th, 2005 08:20 AM
closing connections - application pooling goingmad SQL Server ASP 0 September 29th, 2005 07:19 AM
Closing ADO connections in new page darrenw SQL Server 2000 0 September 15th, 2003 11:48 AM
Closing connections when redirecting alldis Classic ASP Basics 3 July 30th, 2003 08:33 AM



All times are GMT -4. The time now is 07:47 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.