Current location: Hot Scripts Forums » General Community » New Members & Introductions » ADODB.Recordset error '800a0e78' Operation is not allowed when the object is closed.


ADODB.Recordset error '800a0e78' Operation is not allowed when the object is closed.

Reply
  #1 (permalink)  
Old 06-05-09, 11:20 PM
laoclondon laoclondon is offline
New Member
 
Join Date: Jun 2009
Posts: 0
Thanks: 0
Thanked 0 Times in 0 Posts
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

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
101 If (MM_offset >= MM_rsCount Or MM_offset = -1) Then ' past end or move last
102 If ((MM_rsCount Mod MM_size) > 0) Then ' last page not a full repeat region
103 MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
104 Else
105 MM_offset = MM_rsCount - MM_size
106 End If
107 End If
108 End If
109
110 ' move the cursor to the selected record
111 MM_index = 0
112 While ((Not MM_rs.EOF) And (MM_index < MM_offset Or MM_offset = -1))
113 MM_rs.MoveNext
114 MM_index = MM_index + 1
115 Wend
116 If (MM_rs.EOF) Then
117 MM_offset = MM_index ' set MM_offset to the last possible record
118 End If
119
120 End If
121 %>
122 <%
123 *** Move To Record: if we dont know the record count, check the display range
124
125 If (MM_rsCount = -1) Then
126
127 ' walk to the end of the display range for this page
128 MM_index = MM_offset
129 While (Not MM_rs.EOF And (MM_size < 0 Or MM_index < MM_offset + MM_size))
130 MM_rs.MoveNext
131 MM_index = MM_index + 1
132 Wend
133
134 ' if we walked off the end of the recordset, set MM_rsCount and MM_size
135 If (MM_rs.EOF) Then
136 MM_rsCount = MM_index
137 If (MM_size < 0 Or MM_size > MM_rsCount) Then
138 MM_size = MM_rsCount
139 End If
140 End If
141
142 ' if we walked off the end, set the offset based on page size
143 If (MM_rs.EOF And Not MM_paramIsDefined) Then
144 If (MM_offset > MM_rsCount - MM_size Or MM_offset = -1) Then
145 If ((MM_rsCount Mod MM_size) > 0) Then
146 MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
147 Else
148 MM_offset = MM_rsCount - MM_size
149 End If
150 End If
151 End If
152
153 ' reset the cursor to the beginning
154 If (MM_rs.CursorType > 0) Then
155 MM_rs.MoveFirst
156 Else
157 MM_rs.Requery
158 End If
159
160 ' move the cursor to the selected record
161 MM_index = 0
162 While (Not MM_rs.EOF And MM_index < MM_offset)
163 MM_rs.MoveNext
164 MM_index = MM_index + 1
165 Wend
166 End If
167 %>
168 <%
169 *** Move To Record: update recordset stats
170
171 set the first and last displayed record
172 Recordset1_first = MM_offset + 1
173 Recordset1_last = MM_offset + MM_size
174
175 If (MM_rsCount <> -1) Then
176 If (Recordset1_first > MM_rsCount) Then
177 Recordset1_first = MM_rsCount
178 End If
179 If (Recordset1_last > MM_rsCount) Then
180 Recordset1_last = MM_rsCount
181 End If
182 End If
183
184 set the boolean used by hide region to check if we are on the last record
185 MM_atTotal = (MM_rsCount <> -1 And MM_offset + MM_size >= MM_rsCount)
186 %>
187 <%
188 *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
189
190 Dim MM_keepNone
191 Dim MM_keepURL
192 Dim MM_keepForm
193 Dim MM_keepBoth
194
195 Dim MM_removeList
196 Dim MM_item
197 Dim MM_nextItem
198
199 create the list of parameters which should not be maintained
200 MM_removeList = "&index="
201 If (MM_paramName <> "") Then
202 MM_removeList = MM_removeList & "&" & MM_paramName & "="
203 End If
204
205 MM_keepURL=""
206 MM_keepForm=""
207 MM_keepBoth=""
208 MM_keepNone=""
209
210 add the URL parameters to the MM_keepURL string
211 For Each MM_item In Request.QueryString
212 MM_nextItem = "&" & MM_item & "="
213 If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
214 MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))
215 End If
216 Next
217
218 add the Form variables to the MM_keepForm string
219 For Each MM_item In Request.Form
220 MM_nextItem = "&" & MM_item & "="
221 If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
222 MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))
223 End If
224 Next
225
226 create the Form + URL string and remove the intial '&' from each of the strings
227 MM_keepBoth = MM_keepURL & MM_keepForm
228 If (MM_keepBoth <> "") Then
229 MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
230 End If
231 If (MM_keepURL <> "") Then
232 MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
233 End If
234 If (MM_keepForm <> "") Then
235 MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
236 End If
237
238 a utility function used for adding additional parameters to these strings
239 Function MM_joinChar(firstItem)
240 If (firstItem <> "") Then
241 MM_joinChar = "&"
242 Else
243 MM_joinChar = ""
244 End If
245 End Function
246 %>
247 <%
248 *** Move To Record: set the strings for the first, last, next, and previous links
249
250 Dim MM_keepMove
251 Dim MM_moveParam
252 Dim MM_moveFirst
253 Dim MM_moveLast
254 Dim MM_moveNext
255 Dim MM_movePrev
256
257 Dim MM_urlStr
258 Dim MM_paramList
259 Dim MM_paramIndex
260 Dim MM_nextParam
261
262 MM_keepMove = MM_keepBoth
263 MM_moveParam = "index"
264
265 if the page has a repeated region, remove 'offset' from the maintained parameters
266 If (MM_size > 1) Then
267 MM_moveParam = "offset"
268 If (MM_keepMove <> "") Then
269 MM_paramList = Split(MM_keepMove, "&")
270 MM_keepMove = ""
271 For MM_paramIndex = 0 To UBound(MM_paramList)
272 MM_nextParam = Left(MM_paramList(MM_paramIndex), InStr(MM_paramList(MM_paramIndex),"=") - 1)
273 If (StrComp(MM_nextParam,MM_moveParam,1) <> 0) Then
274 MM_keepMove = MM_keepMove & "&" & MM_paramList(MM_paramIndex)
275 End If
276 Next
277 If (MM_keepMove <> "") Then
278 MM_keepMove = Right(MM_keepMove, Len(MM_keepMove) - 1)
279 End If
280 End If
281 End If
282
283 set the strings for the move to links
284 If (MM_keepMove <> "") Then
285 MM_keepMove = MM_keepMove & "&"
286 End If
287
288 MM_urlStr = Request.ServerVariables("URL") & "?" & MM_keepMove & MM_moveParam & "="
289
290 MM_moveFirst = MM_urlStr & "0"
291 MM_moveLast = MM_urlStr & "-1"
292 MM_moveNext = MM_urlStr & CStr(MM_offset + MM_size)
293 If (MM_offset - MM_size < 0) Then
294 MM_movePrev = MM_urlStr & "0"
295 Else
296 MM_movePrev = MM_urlStr & CStr(MM_offset - MM_size)
297 End If
298 %>
299 <html>
300 <head>
301 <title>London Adult Online Community</title>
302 <!-- meta information for search engines -->
303 <meta name="generator" content="Nucleus CMS v3.32" />
304 <meta name="name" content="London Adult Online Community" />
305 <meta name="description" content="" />
306 <link rel="bookmark" title="Nucleus" href="http://nucleuscms.org/" />
307 <link rel="archives" title="Archives" href="index.htm?archivelist=1" />
308 <link rel="top" title="Today" href="index.htm?blogid=1" />
309 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
310 </head>
311
312 <body>
313 <table width="866" border="2" cellpadding="3" cellspacing="0" bordercolor="#CCCCCC">
314 <tr>
315 <td width="500" bgcolor="#0099FF"><div align="center"><strong><font color="#FFFFFF" size="4" face="Verdana, Arial, Helvetica, sans-serif">LONDON
316 ADULT ONLINE COMMUNITY</font></strong></div></td>
317 <td width="125"><img src="lOGO/ben.jpg" width="146" height="115" /></td>
318 <td width="125"><img src="lOGO/Parliament.jpg" width="150" height="115" /></td>
319 <td width="125"><img src="lOGO/Tower%20Bridge.jpg" width="135" height="115" /></td>
320 </tr>
321 </table>
322 </p>
323 <p>&nbsp;
324 <table width="866" border="2" cellpadding="3" cellspacing="0" bgcolor="#0099FF">
325 <tr>
326 <td width="280"><font color="#333333"><strong><a href="LondonAdultOnlineCommunityHomePage.asp">Home </a></strong></font></td>
327 <td width="280"><font color="#333333"><strong><a href="Classified%20Advert%20Homepage.asp">Classifi ed
328 Advert</a></strong></font></td>
329 <td width="280"><font color="#333333"><strong><a href="Classified%20Advert.asp">Place
330 an Advert</a></strong></font></td>
331 <td width="280"><font color="#333333"><strong><a href="Classified%20Advert%20Search%20Return.asp">S earch
332 Classified Adverts</a></strong></font></td>
333 </tr>
334 </table>
335 <table width="866" height="55" border="2" cellpadding="3" cellspacing="0" bgcolor="#33FF33">
336 <tr>
337 <td width="247" height="51" bgcolor="#33FF33"> <form method="get" action="index.htm">
338 <div class="searchform"> <strong>
339 <input type="hidden" name="amount" value="0" />
340 <input type="hidden" name="blogid" value="1" />
341 <input name="query" alt="Keywords to search" class="formfield" size="10" maxlength="60" accesskey="4" value="" />
342 <input name="submit" type="submit" class="formbutton" value="Search" alt="Search" />
343 </strong></div>
344 </form></td>
345 <td width="78" height="51" valign="top" bgcolor="#33FF33"><font color="#333333"><strong><font color="#333333"><strong><a href="log%20in.asp">Login</a></strong></font></strong></font></td>
346 <td width="119" height="51" valign="top" bgcolor="#33FF33"><font color="#333333"><strong><font color="#333333"><strong><a href="membership%20registration.asp">Membership</a>
347 </strong></font></strong></font></td>
348 <td width="133" height="51" align="right" valign="top" bgcolor="#33FF33"><font color="#333333"><font color="#333333"><strong>Font
349 Size </strong></font></font></td>
350 <td width="73" height="51" border="2"> <form class="accessiblity textSmall" method="post" action="Accessibility%20Statement.htm">
351 <input type="hidden" name="TextSize2" value="small"/>
352 <font color="#333333"><strong>
353 <input name="submit2" type="submit" value="Small"/>
354 </strong></font> </form></td>
355 <td width="84" height="51" border="2"> <form class="accessiblity textMedium" method="post" action="/Accessibility%20Statementmeduim.htm">
356 <font color="#333333"><strong>
357 <input type="hidden" name="TextSize" value="medium"/>
358 <input name="submit3" type="submit" value="Medium"/>
359 </strong><font size=""></font></font> </form></td>
360 <td width="72" height="51"> <form class="accessiblity textLarge" method="post" action="Accessibility%20Statement.htm">
361 <font color="#33FF33"><strong>
362 <input type="hidden" name="TextSize" value="large"/>
363 <input name="submit4" type="submit" value="Large"/>
364 </strong></font> </form></td>
365 </tr>
366 </table>
367 <p>&nbsp;</p>
368 <p><font color="#333333">Search and view the free London Adult Online Community
369 Classified Adverts </font> </p>
370 <p><font color="#333333">All of our Classified content are easily accessible and
371 online</font></p>
372 <p><font color="#333333">You can see anything in our classified adverts, Buy tables,
373 sofas, fridges, television online</font></p>
374 <p><font color="#333333"> </font></p>
375 <p><font size="4"><strong>Search Classified Adverts</strong></font></p>
376 <form action="" method="post" name="Advert" id="Advert">
377 <table width="866" border="2" cellpadding="3" cellspacing="0">
378 <tr>
379 <td width="200" height="25" bgcolor="#00CCFF"><A HREF="<%=MM_moveFirst%>"><strong>First</strong></A></td>
380 <td width="200" height="25" bgcolor="#00FF66"><a href="<%=MM_movePrev%>"><font color="#333333"><strong>Previous</strong></font></a></td>
381 <td width="200" height="25" bgcolor="#00CCFF"><a href="<%=MM_moveNext%>"><strong>Next</strong></a></td>
382 <td width="200" bgcolor="#00FF66"><A HREF="<%=MM_moveLast%>"><strong>Last</strong></A></td>
383 </table>
384 <p>&nbsp;</p>
385 <table width="866" border="2" cellpadding="3" cellspacing="0">
386 <tr>
387 <td width="200" height="25" bgcolor="#00CCFF"><font color="#333333">Item</font></td>
388 <td width="200" height="25" bgcolor="#00FF66"><font color="#333333"><%=(Recordset1.Fields.Item("Item") .Value)%></font></td>
389 <td width="200" height="25" bgcolor="#00CCFF"><font color="#333333">Category
390 Type</font></td>
391 <td width="200" bgcolor="#00FF66"><font color="#333333"><%=(Recordset1.Fields.Item("Catego ry Type").Value)%> </font></td>
392 </table>
393 <table width="866" border="2" cellpadding="3" cellspacing="0">
394 <tr>
395 <td width="200" height="50" valign="top" bgcolor="#00CCFF"><font color="#333333">Photo</font></td>
396 <td width="200" bgcolor="#00FF66"><font color="#333333"><%=(Recordset1.Fields.Item("Photo" ).Value)%></font> </td>
397 <td width="200" valign="top" bgcolor="#00CCFF"><font color="#333333">Description
398 </font></td>
399 <td width="200" bgcolor="#00FF66"><font color="#333333"><%=(Recordset1.Fields.Item("Descri ption").Value)%></font> </td>
400 </table>
401 <table width="866" border="2" cellpadding="3" cellspacing="0">
402 <tr>
403 <td width="200" height="25" bgcolor="#00CCFF"><font color="#333333">Price</font></td>
404 <td width="200" bgcolor="#00FF66"><font color="#333333"><%=(Recordset1.Fields.Item("Price" ).Value)%></font> </td>
405 <td width="200" bgcolor="#00CCFF"><font color="#333333">Town </font></td>
406 <td width="200" bgcolor="#00FF66"><font color="#333333"><%=(Recordset1.Fields.Item("Town") .Value)%></font> </td>
407 </table>
408 <table width="866" border="2" cellpadding="3" cellspacing="0">
409 <tr>
410 <td width="200" height="25" bgcolor="#00CCFF"><font color="#333333">Contact
411 Details</font></td>
412 <td width="200" bgcolor="#00FF66"><font color="#333333"><%=(Recordset1.Fields.Item("Contac t Details").Value)%> </font></td>
413 <td width="200" bgcolor="#00CCFF"><font color="#333333">Publish Date </font></td>
414 <td width="200" bgcolor="#00FF66"><font color="#333333"><%=(Recordset1.Fields.Item("Publis h Date").Value)%> </font></td>
415 </table>
416 </form>
417 <p>&nbsp;</p>
418 <table width="866" border="2" cellpadding="3" cellspacing="0">
419 <tr>
420 <td width="125" height="75" ><a href="http://www.ivillage.co.uk/homegarden"><img src="lOGO/iVillage_logo1.jpg" width="370" height="100" border="0"></a></td>
421 <td width="125"><a href="http://www.loot.com/"><img src="lOGO/loots%20logo.gif" width="154" height="91" border="0"></a></td>
422 <td width="150"><a href="http://www.cargiant.co.uk/"><img src="lOGO/car%20giant.gif" width="216" height="117" border="0"></a></td>
423 </table>
424 <p>&nbsp;</p>
425
426 <table width="866" border="2" cellpadding="3" cellspacing="0">
427 <tr>
428 <td width="125"><strong><font color="#333333"><a href="Mission%20Statement.htm">Mission
429 Statement</a></font></strong></td>
430 <td width="125"><strong><font color="#333333"><a href="Contact%20Us.asp">Contact
431 us</a></font></strong></td>
432 <td width="125"><strong><font color="#333333"><a href="Terms%20and%20Conditions.htm">Terms
433 &amp; Conditions</a></font></strong></td>
434 <td width="125"><strong><font color="#333333"><a href="Privacy%20Policy.htm">Privacy
435 Policy</a></font></strong></td>
436 <td width="125"><strong><font color="#333333"><a href="Accessibility%20Statement.htm">Accessibility </a></font></strong></td>
437 </table>
438 Copyright &copy; 2009 by London Adult Online Community. All Rights Reserved </p>
439 </body>
440 </html>
441 <%
442 Recordset1.Close()
443 Set Recordset1 = Nothing
444 %>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks

« Hello! | Hello! »

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a browser RPG in javascript SolidSamurai JavaScript 26 10-20-08 04:27 PM
Operation is not allowed when the object is closed. lamore ASP 1 06-11-08 03:27 AM
Operation is not allowed when the object is closed. Problem peasoup ASP 2 11-02-06 03:44 PM
Object Oriented Programming Stefan PHP 29 12-30-03 12:22 PM


All times are GMT -5. The time now is 06:46 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.