 |
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

November 21st, 2004, 11:59 PM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

November 22nd, 2004, 12:21 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
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
|
|

November 22nd, 2004, 12:34 AM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

November 22nd, 2004, 12:48 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
;;;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
|
|

November 22nd, 2004, 12:56 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
Correction re-boot, no. Restart web services, yes
Are you using session variables? If so check sesisons are enabled
Wind is your friend
Matt
|
|

November 22nd, 2004, 02:44 AM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|

November 22nd, 2004, 06:31 PM
|
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
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
|
|

November 22nd, 2004, 09:30 PM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

November 22nd, 2004, 09:41 PM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|

November 22nd, 2004, 10:18 PM
|
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
;;;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
|
|
 |