title: Recordset in asp and execute stored procedure in asp
body: <p>I want to open another .asp page from one .asp page on button click following is the code i have done but error is coming</p>
  
  <p>Error is coming as "<strong>operation is not allowed when the object is closed</strong>"</p>
  
  <p>Here is the code </p>
  
  <pre><code> Dim dbconn, objCmd, objParam, rs, EmailID, Password, connString, RecordCount
  
   connString = "Connectionstring"
  
   dbconn = Server.CreateObject("ADODB.Connection")
  
   dbconn.Open(connString)
  
   rs = Server.CreateObject("ADODB.RecordSet")
  
   objCmd = Server.CreateObject("ADODB.Command")
   objCmd.ActiveConnection = dbconn
   objCmd.CommandText = "sp_Name"
   objCmd.CommandType = &amp;H0004 
   objParam = objCmd.CreateParameter("@EmailID",200,1,"100",Session("EmailID"))
   objCmd.Parameters.Append(objParam)
  
    objParam = objCmd.CreateParameter("@Password",200,1,"100",Session("Password"))
    objCmd.Parameters.Append(objParam)
  
     rs = objCmd.Execute(Session("EmailID"),Session("Password"))
  
     do while not rs.eof -------&gt;here comes error 
  
      EmailID = rs(0)
      Password =  rs(1)
      'response.Write EmailID &amp; "," &amp; Password &amp; "&lt;br"&gt;
      rs.MoveNext
  loop
  </code></pre>