If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Error :"Object required Cn was not handled"

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-21-04, 03:25
graceson graceson is offline
Registered User
 
Join Date: Mar 2004
Location: India
Posts: 56
Smile 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
Reply With Quote
  #2 (permalink)  
Old 07-21-04, 20:59
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
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.
Reply With Quote
  #3 (permalink)  
Old 07-22-04, 03:25
graceson graceson is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 07-22-04, 19:02
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
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>
Reply With Quote
  #5 (permalink)  
Old 07-23-04, 05:19
graceson graceson is offline
Registered User
 
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
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On