Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > Server Side Programming > ASP and ASP.NET
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 06-05-2009, 11:47 PM
  #1
laoclondon
Novice (Level 1)
 
Join Date: Jun 2009
Posts: 1
iTrader: (0)
laoclondon is an unknown quantity at this point
ADODB.Recordset error '800a0e78' Operation is not allowed when the object is closed

Hello

I need help. I'm getting this error message when i open one of my asp webpage. any suggestion how i can change my coding to make it work.
Error:

ADODB.Recordset error '800a0e78'
Operation is not allowed when the object is closed.
/l/a/o/laoclondon/Classified Advert Search Return.asp, line 28

This is my coding
Code:
						
1	<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> 						
2	<!--#include file="Connections/Classified.asp" -->						
3	<%						
4	Dim Recordset1						
5	Dim Recordset1_numRows						
6							
7	set oConnection=Server.CreateObject("ADODB.Connection")						
8	oConnection.Provider="Microsoft.Jet.OLEDB.4.0"						
9	oConnection.Open(Server.Mappath("database/Classified Advert.mdb"))						
10	oConnection.close						
11	Set oConnection = Nothing						
12	Create an ADO RecordSet object						
13	Set Recordset1 = Server.CreateObject("ADODB.Recordset")						
14	Recordset1.Source = "SELECT * FROM Table1"						
15	Recordset1.CursorType = 0						
16	Recordset1.CursorLocation = 2						
17	Recordset1.LockType = 1						
18							
19							
20	Recordset1_numRows = 0						
21	%>						
22	<%						
23	  *** Recordset Stats, Move To Record, and Go To Record: declare stats variables						
24							
25	Dim Recordset1_total						
26	Dim Recordset1_first						
27	Dim Recordset1_last						
28	Recordset1_total = Recordset1.RecordCount						
29	 set the record count						
30							
31							
32	 set the number of rows displayed on this page						
33	If (Recordset1_numRows < 0) Then						
34	  Recordset1_numRows = Recordset1_total						
35	Elseif (Recordset1_numRows = 0) Then						
36	  Recordset1_numRows = 1						
37	End If						
38							
39	 set the first and last displayed record						
40	Recordset1_first = 1						
41	Recordset1_last  = Recordset1_first + Recordset1_numRows - 1						
42							
43	 if we have the correct record count, check the other stats						
44	If (Recordset1_total <> -1) Then						
45	  If (Recordset1_first > Recordset1_total) Then						
46	    Recordset1_first = Recordset1_total						
47	  End If						
48	  If (Recordset1_last > Recordset1_total) Then						
49	    Recordset1_last = Recordset1_total						
50	  End If						
51	  If (Recordset1_numRows > Recordset1_total) Then						
52	    Recordset1_numRows = Recordset1_total						
53	  End If						
54	End If						
55	%>						
56	<%						
57	Dim MM_paramName 						
58	%>						
59	<%						
60	 *** Move To Record and Go To Record: declare variables						
61							
62	Dim MM_rs						
63	Dim MM_rsCount						
64	Dim MM_size						
65	Dim MM_uniqueCol						
66	Dim MM_offset						
67	Dim MM_atTotal						
68	Dim MM_paramIsDefined						
69							
70	Dim MM_param						
71	Dim MM_index						
72							
73	Set MM_rs    = Recordset1						
74	MM_rsCount   = Recordset1_total						
75	MM_size      = Recordset1_numRows						
76	MM_uniqueCol = ""						
77	MM_paramName = ""						
78	MM_offset = 0						
79	MM_atTotal = false						
80	MM_paramIsDefined = false						
81	If (MM_paramName <> "") Then						
82	  MM_paramIsDefined = (Request.QueryString(MM_paramName) <> "")						
83	End If						
84	%>						
85	<%						
86	 *** Move To Record: handle 'index' or 'offset' parameter						
87							
88	if (Not MM_paramIsDefined And MM_rsCount <> 0) then						
89							
90	  ' use index parameter if defined, otherwise use offset parameter						
91	  MM_param = Request.QueryString("index")						
92	  If (MM_param = "") Then						
93	    MM_param = Request.QueryString("offset")						
94	  End If						
95	  If (MM_param <> "") Then						
96	    MM_offset = Int(MM_param)						
97	  End If						
98							
99	  ' if we have a record count, check if we are past the end of the recordset						
100	  If (MM_rsCount <> -1) Then

Last edited by Horus_Kol : 06-06-2009 at 06:26 AM.
laoclondon is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 06-30-2009, 11:32 AM
  #2
GrillMonkey
Warrior (Level 8)
 
Join Date: Jun 2009
Posts: 71
iTrader: (0)
GrillMonkey is an unknown quantity at this point
It's been a long time since I've used classic asp and ado but...

Line 10 : oConnection.close

You've closed your connection before filling and using your recordset and I can't see anywhere where you open the recordset either....

take a look here for ADO and ASP:

http://www.w3schools.com/ado/ado_recordset.asp
GrillMonkey is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 07-17-2009, 02:32 PM
  #3
thewebhostingdi
Adept (Level 5)
 
Join Date: Jun 2009
Posts: 43
iTrader: (0)
thewebhostingdi is an unknown quantity at this point
You are attempting to access the data after the recordset has been closed. You need an open connection to deal with the data trannsfer between your page<=> DB.
thewebhostingdi is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Reply
KEEP TABS
SPONSORS
 
Boxedart

 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  POSTING RULES
 
 
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 02:12 AM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.