Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2004
    Location
    India
    Posts
    56

    Smile Unanswered: Error :"Object required Cn was not handled"

    Dear freinds,

    Can you help me in following error in ASP.It is occuring after the browsing of the page .

    "Microsoft VbScript Error : Object required 'cn' was not handled"

    Actually this "cn" is the connection object, which I am using in global.asa.When I am debugging the message , it points to the line "cn.close".

    But it appears after the page closed,and message is getting in sever.


    rgds,
    Graceson Mathew

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    Unfortunately with what you have given us I can't help much, post the code itself and we should be able to lend assistance though.

  3. #3
    Join Date
    Mar 2004
    Location
    India
    Posts
    56

    Object required "cn" was not handled

    Please check the code , from which i am getting a error message after browsing the asp pages.This is global.asa.


    When I am debuging from the error messaseg, it poits to line "cn.close"




    <SCRIPT LANGUAGE="VBScript" RUNAT="Server">

    Sub Session_OnStart ' Runs the first time a user runs any page in your application

    'Create an ADO Connection
    Set cn = Server.CreateObject("ADODB.Connection")


    ProvStr = "dsn=CEC_cal;UID=Administrator;PWD=servoking;datab ase=calender"
    cn.Open ProvStr

    Set Session("cnn") = cn

    END Sub
    on error resume next

    Sub Session_OnEnd ' Runs when a user's session times out or quits your application

    'Close the data connection
    cn.Close
    set cn=nothing

    END Sub

    </SCRIPT>


    Thank you

    graceson

  4. #4
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    I see what you are trying to do,.. good luck with it.... to solve your problem try something more like this...

    Code:
    <SCRIPT LANGUAGE="VBScript" RUNAT="Server">
    
    Sub Session_OnStart ' Runs the first time a user runs any page in your application
    
    'Create an ADO Connection
      Set cn = Server.CreateObject("ADODB.Connection")
      ProvStr = "dsn=CEC_cal;UID=Administrator;PWD=servoking;databa se=calender"
      cn.Open ProvStr
      Set Session("cnn") = cn
    
    END Sub
    
    Sub Session_OnEnd ' Runs when a user's session times out or quits your application
    '  Close the data connection
      set cn=Session("cnn")
      cn.Close 
      set cn=nothing 
    
    END Sub
    
    </SCRIPT>

  5. #5
    Join Date
    Mar 2004
    Location
    India
    Posts
    56

    "cn" object error solved

    Dear Friend,


    Ya , above mensioned code by 'rockslide' solved my problem of "cn" object error

    Thank you so much. Thanks dbforum


    rgds

    Graceson

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •