Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 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 April 20th, 2005, 11:18 AM
Kel Kel is offline
Registered User
 
Join Date: Apr 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error

Hi
I'm trying to connect to an sql database and retrieve data. I'm getting the folloring error message:
ADODB.Recordset error '800a0e7d'

Operation is not allowed on an object referencing a closed or invalid connection.

The code used is as follows:
<%
dim cn,strconn
Response.AddHeader "Pragma", "No-Cache"
Response.CacheControl = "private"
Response.Expires=-1
Response.Buffer=true

strconn="DSN=DSNop210440b;" & _
         "Uid=op210440b;" & _
         "Pwd=50405258"

set cn = Server.CreateObject("ADODB.connection")
On Error Resume Next
For i=1 to 3
    If cn.State=adStateClosed Then
    cn.Open strConn
    Else
    Exit For
    End If
Next

On Error GoTo 0
Response.Expires=0
Session.Timeout = 60

%>

Thanks
Kel
 
Old April 20th, 2005, 12:24 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 303
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In the code you have posted where is your recordset and where in the code you're opening your recordset?

 
Old April 21st, 2005, 07:59 AM
Kel Kel is offline
Registered User
 
Join Date: Apr 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi
yes everything is ok. do you think that the problem can be on the server where the site is lodged?
thanks
kel






Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Query Error & Run-Time Error 3022 DavidWE Access 1 July 31st, 2008 11:17 AM
Ch 4: Parse error: syntax error, unexpected T_SL hanizar77 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 June 23rd, 2008 09:17 PM
[Resolved] Error calling a sp - parameter error snufse .NET Framework 2.0 2 February 12th, 2008 04:46 PM
Parse error: syntax error, unexpected T_STRING ginost7 Beginning PHP 1 November 9th, 2007 02:51 AM
Phile Page error, visual studio error reps BOOK: ASP.NET Website Programming Problem-Design-Solution 0 September 27th, 2003 10:11 AM





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