Intermittent 80040201 and 800a01fb errors

Discussion in 'Classic ASP' started by cirrus, Jan 2, 2005.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi

    Not sure whether this is a database or CDO problem.

    Basically I am sending an Email using .CreateMHTMLBody the page for the HTML is an ASP page which connects to a database. It works fine for 2 or 3 Emails. Then I will get the following errors

    error '80040201'
    /sendenquiryemail.asp, line 40 (line 40= objMessage.fields.update)

    or


    error '80040201'
    /sendenquiryemail.asp, line22 (line 22 = Set Flds = objConfig.Fields

    at the same time pages that normally access the database will throw up the following error

    Microsoft VBScript runtime error '800a01fb'

    An exception occurred: 'viewdbConn.Open'

    /viewdb.asp, line 30

    If I wait a few minutes database access comes back normally but it takes a lot longer for CDO to come back.

    I have been very careful to ensure that all database connections are closed but it looks like they are not closed when using CreateMHTMLBody. The target page for CreateMHTMLBody works perfectly well and doesn't lock up the server when used repeatedly.

    Any suggestions?

    Steve
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    Are you setting your object to nothing after you are done with using it.

    eg.

    Set objMessage = nothing.

    ASP do not have automatic garbage collection, and over time the system will not allow you to create more objects.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. Yes.

    Set ObjMessage = nothing
    Set ObjConfig = nothing
    everytime.

    That is why I am so puzzled.

    Not always so diligent with database connections in the past but went through the entire site last week, after reading other posts on this forum, and made sure that everything opened is now closed and set to nothing as soon as possible.

    Should I Set MyRS = nothing even if MyRS.Close causes an 'object required' error ie when MyRs is the result of an SQL function like AVG or MAX?

    'ASP do not have automatic garbage collection, and over time the system will not allow you to create more objects.' Is that an absolute in that eventually I will not be able create any objects at all, ever- or are we talking within a session or some other time period?

    If ASP does not have automatic garabage collection - how does one garbage collect manually?

    Regards
    Steve
     
  4. Bruce

    Bruce DiscountASP.NET Staff

    when you set record set to close, it closes the connection but i do not think the object is discard.

    >If ASP does not have automatic garabage collection - how does one garbage collect manually?

    Setting this to nothing will release the object.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  5. I'm now convinced that CreateMHTMLBody is the cause of the problem.


    I can successfully send one or two emails but then the error messages start. It doesn't make any difference if the target page requires a database connection or not. The target page can be repeatedly refreshed with out problem. When the createMHTMLBody page crashes it is several minutes before any page that needs a database connection will work again.


    All objects are set = nothing when not being used


    I don't have problems with TextBody or HTMLBody only when CreateMHTMLBody is used. I don't get the problem at all on my own machine (Windows 2000) only on the web server.


    Seems to me that something is not right at the server end.


    Would be interested to know if anyone out there is successfully using CreateMHTMLBody, when it works it is perfect for what I am trying to do. [​IMG]


    Steve
     
  6. Can you post your entire code? I'm not able to replicate the issue on my site at Discountasp when using CreateMHTMLBody.
     
  7. Sorry about the delay.


    I found a work round for my immediate problem was to open up the target page in IE and then click on Send by Email.


    However I need to be able to send html formated Email automatically too


    This is the code I have been using


    set objMessage = createobject("cdo.message")
    set objConfig = createobject("cdo.configuration")


    ' Setting the SMTP Server
    Set Flds = objConfig.Fields


    Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"


    'Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
    'Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:\Inetpub\mailroot\pickup"


    Flds.update


    Set objMessage.Configuration = objConfig
    objMessage.To = "[email protected]"
    objMessage.From = "[email protected]"
    objMessage.Subject = "subject"
    'objmessage.textbody = "test"
    objMessage.createMHTMLbody "http://www.discountasp.net"
    objMessage.fields.update
    objMessage.Send


    set objMessage = nothing
    set objConfig = nothing
    With the exception of createMHTMLbody this looks exactly like the example in the knowledge base and seemed to work perfectly well using textbody. The problems have only started since I started using createMHTMLbody.

    On my own machine I can repeatedly send Emails but the Discountasp web server locks up after about 3 or 4.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page