Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 21st, 2007, 04:29 PM
Registered User
 
Join Date: Aug 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default ADODB.Recordset error 800a0e78

I'm having some trouble debugging my code and I keep getting this error: Operation is not allowed when the object is closed.

This references line #58 in my code which is marked by the ** below

Any help debugging would be greatly appreciated.
__________________________________________________ ________________



   Server.ScriptTimeout = 60*5

   SET objConn = Server.CreateObject("ADODB.Connection")

   ' Open Connection...
   objConn.ConnectionTimeout = 240
   objConn.Open sAUDIT_DB_CONNECT


   ' Call Report...
   Set Cmd = Server.CreateObject("ADODB.Command")
   Cmd.ActiveConnection = objConn
   Cmd.CommandTimeout = 0
   Cmd.CommandText = sSQL
   Set objResults = Cmd.Execute


  ** If objResults.EOF Then

      bTrue = 1
   Else
      bTrue = 0
   End If


   If bTrue Then %>

      <html>
     <% Response.Write "Success"%>
      </html>

      <%
         objResults.Close
         SET objResults = NOTHING
         SET objConn = Nothing


   Else %>

      <html>

      <% Response.Write "Sorry, an error has occured."%>

<% End If


Else
%>
   <html>
   SECTION 3
   </html>
<%
End If
%>

 
Old September 26th, 2007, 02:23 AM
Authorized User
 
Join Date: Dec 2006
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default


In your code u have no explanation fro objResults variable.

Add this code before using objResults

Dim objResults
Set objResults=Server.CreateObject("ADODB.RecordSet")


 
Old October 1st, 2007, 11:59 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What is contained in sSQL?

Your code assumes that a recordset is being returned. However, your code (as shown) does not set sSQL to anything.

Woody Z
http://www.learntoprogramnow.com
How to use a forum to help solve problems
 
Old October 2nd, 2007, 09:21 AM
Registered User
 
Join Date: Aug 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

sSQL is passed in when the page is called.
each variable will be defined in the asp call.

 
Old October 2nd, 2007, 04:27 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

So is sSQL a valid sql select statement in all cases?

Woody Z
http://www.learntoprogramnow.com
How to use a forum to help solve problems
 
Old October 2nd, 2007, 04:31 PM
Registered User
 
Join Date: Aug 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

yes. It will always be valid. The problem comes about as this page is called multiple times in quick succession with different data fields each time. Some of these calls fail - while others succeed. I'm trying to troubleshoot the failures but can not pick out any distinct patterns as to what will fail and what will succeed.

 
Old October 2nd, 2007, 05:13 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

One thing to do is to make sure you are closing your db connections rather than just setting the connection to nothing.

It is possible that you are getting occasionally mal-formed sql statements, but that probably isn't the first place to look except that it is easy to include the sSQL statement in your display of the error page if you have the freedom to do that.

Is the database only being used for reading data, or are you inserting data as well interspersed with the reading? You might have some locking issues. Unlikely, perhaps, but possible.

What kind of database? Sql Server? Access?

Anyway - start with closing those connections.

Woody Z
http://www.learntoprogramnow.com
How to use a forum to help solve problems





Similar Threads
Thread Thread Starter Forum Replies Last Post
ADODB.Recordset error lance Wrox Book Feedback 2 February 23rd, 2007 02:37 PM
ADODB.RecordSet -- Error nabeeljohn Classic ASP Professional 10 November 9th, 2006 05:23 AM
ADODB.Recordset error '800a0e78' Orpheus Classic ASP Databases 2 March 27th, 2006 10:05 AM
ADODB.Recordset error '800a0e78' nancy Classic ASP Databases 6 September 1st, 2004 09:42 AM
ADODB.Recordset error '800a0cc1'Item cannot be.... ashu_gupta75 Classic ASP Databases 1 March 5th, 2004 03:50 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.