INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Error 'ASP 0115', Trappable error (C0000005) occurred in an external object

Error 'ASP 0115', Trappable error (C0000005) occurred in an external object

Error 'ASP 0115', Trappable error (C0000005) occurred in an external object

(OP)
Hi all

I've got quite a heavy traffic classic ASP site (I know it needs converting to .Net at some point) which runs fine 90% of the time but occasionally I get an error 'ASP 0115' Unexpected Error.
A trappable error (C0000005) occurred in an external object. The script cannot continue running.

This happens on every single page/Ajax call.

It happens consistently for around 20 minutes and then just vanishes.

For each page I am including a list of classes (literally <!--#include file="../classes/MyClass.asp"-->) and then creating a new version of my Database class (set cDB=new Database) which holds connection information etc. And killing it at the end of each page.

Searching online a lot of people with this error are blaming 3rd party components and objects, however I'm not using any. The only CreateObjects i have is one ADODB.Connection, several instances of ADODB.Recordset and I'm using the Scripting.FileSystemObject from time to time - although I don't think that can be causing the issue as it's used rarely.

Basically it's a massive site (33 classes and numerous controllers) so I'm not expecting anyone to error trap it for me! But I just don't know where to start looking to figure out the cause of this error. Can anyone offer any advice or point me in the right direction please?

Thanks

~S~

RE: Error 'ASP 0115', Trappable error (C0000005) occurred in an external object

With AJAX, there will be a server and a client. Can you log what the server receives and the XML it sends out? Just write it to a file with a timestamp.

Do you still try to access the DB if it is unable to connect?

RE: Error 'ASP 0115', Trappable error (C0000005) occurred in an external object

(OP)
It's not getting far enough through the process when the error occurs. It's literally failing at the first line:

<%
set DB=new Database
%>

So it must be a problem in the Database class but without a line number or a proper error message to go on and I'm a bit stuck. I believe it's falling over trying to create the objects in class_initialize(). I know it sounds crazy but I think the problem is happening on creating either the ADODB.Connection or the Scripting.Dictionary. I've no idea what could cause this.

CODE --> ASP

private sub class_initialize()
  set Me.Connection=Server.CreateObject("ADODB.Connection")
  set Me.Pages=Server.CreateObject("Scripting.Dictionary")
  '* Create a load more dictionary objects
  Me.Connect()

end sub 

Currently the site is working totally fine again and as I'm unable to manually replicate the error I'm a bit stuck with any more to go on until the next time it happens :\

~S~

RE: Error 'ASP 0115', Trappable error (C0000005) occurred in an external object

(OP)
In case this is useful to anyone else I traced the error down to the following line which is happening in class_initialize()

set m_Connection=CreateObject("ADODB.Connection")

For some strange reason the error was occurring when trying to set up the connection object. I think it must be to do with the connection not being closed properly within the same session (perhaps during a session timeout). To get around this problems (and this may not be the tidiest solution but it seems to work) I have changed the line to:

set m_Connection=nothing
set m_Connection=CreateObject("ADODB.Connection")

By first setting the object to nothing and then re-creating the object the error disappears.

~S~

RE: Error 'ASP 0115', Trappable error (C0000005) occurred in an external object

Perhaps you should set it to nothing in the class_terminate, which is when the class is deleted.

RE: Error 'ASP 0115', Trappable error (C0000005) occurred in an external object

(OP)
Yes - I am, of course, already setting it to nothing in the class_terminate.

I am also setting the instance of the Database class itself to nothing at the end of each page to ensure the class_terminate is fired.

This is why it was such a peculiar error and I have had to put it down to the session timing out and somehow leaving the variable in memory.

Weird one. Never really got to the bottom of it but at least I found a workaround...

~S~

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close