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 July 2nd, 2006, 11:17 PM
Registered User
 
Join Date: Jul 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Get the error "ADODB.Recordset error '800a0e7d' "

 I'm trying to connect to an Access database and retrieve data. I'm getting the folloring error message:

ADODB.Recordset error '800a0e7d'

The connection cannot be used to perform this operation. It is either closed or invalid in this context.

/legco/script/common.inc, line 52

The code used is as follows:
sRSSource will input a SQL

Function GetRecordset(sRSSource)
    Dim objRSGetRecordset

    Set objRSGetRecordset = Server.CreateObject("ADODB.RecordSet")
'' objRSGetRecordset.Open sRSSource, cnn, adOpenStatic, adLockOptimistic
    objRSGetRecordset.Open sRSSource, cnn, adOpenStatic, adLockReadOnly

    Set GetRecordset = objRSGetRecordset

    'objRSGetRecordset.Close
    Set objRSGetRecordset = Nothing
End Function

Any help or suggestion is much appreciated!

thanks...

Raymond


 
Old July 24th, 2006, 11:49 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 479
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default

solution here
http://p2p.wrox.com/topic.asp?TOPIC_ID=1858

surendran
(Anything is Possible)
 
Old August 5th, 2006, 03:53 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 198
Thanks: 2
Thanked 0 Times in 0 Posts
Send a message via MSN to itHighway
Default

There are two reasons for this error.

1- Sql query contain an invalid database column name.
2- System can not read from connection variable.

Do Following:
Check your sql query and if there is a complex query try checking it by temrorary replacing it with a simple one i.e "SELECT * FROM tblRecords"

If you still get the same problem then

Write following after Function GetRecordset(sRSSource) statement and execute the page again.
response.write(cnn)
response.end

If page does not display anything then check you connection variable i.e 'cnn'. You probably need to define 'cnn' variable before database connection string i.e 'dim cnn'






Similar Threads
Thread Thread Starter Forum Replies Last Post
Help: ADODB.Recordset error '800a0e7d' comets Classic ASP Databases 5 October 15th, 2011 11:27 AM
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 '800a0e7d' hurler Classic ASP Databases 4 August 28th, 2003 09:47 PM





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