/ Forside / Teknologi / Udvikling / ASP / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
ASP
#NavnPoint
smorch 9259
Harlekin 1866
molokyle 1040
Steffanst.. 758
gandalf 657
smilly 564
gibson 560
cumano 530
MouseKeep.. 480
10  Random 410
Fejl40 måske: Operation is not allowed on ~
Fra : Møller


Dato : 24-05-01 13:07

Jeg få denne meddelelse på siden
www20.brinkster.com/moller06/result.asp

ADODB.Recordset error '800a0e7d'

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

/moller06/result.asp, line 17

Her kommer koden altså, hvis det hjælper... Jeg er meget grøn i
dette her... så være så venlig at hjælpe mig.

<%@LANGUAGE="VBSCRIPT"%>

<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "k"
if (Request.QueryString("textField") <> "") then
Recordset1__MMColParam = Request.QueryString("textField")
%>
<%
set Recordset1 = Server.CreateObject("ADODB.Recordset")
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; "
DSN = DSN & "DBQ=" & Server.MapPath ("\moller06\db\db1.mdb")

Recordset1.Source = "SELECT * FROM Tabel1 WHERE Kunstner LIKE
'%" + Replace(Recordset1__MMColParam, "'", "''") + "%' OR Titel
LIKE '%" + Replace(Recordset1__MMColParam, "'", "''") + "%'
ORDER BY Kunstner ASC, Titel, form"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2

Recordset1.Open DSN
Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = -1
Dim Repeat1__index
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare
stats variables

' set the record count
Recordset1_total = Recordset1.RecordCount

' set the number of rows displayed on this page
If (Recordset1_numRows < 0) Then
Recordset1_numRows = Recordset1_total
Elseif (Recordset1_numRows = 0) Then
Recordset1_numRows = 1
End If

' set the first and last displayed record
Recordset1_first = 1
Recordset1_last = Recordset1_first + Recordset1_numRows - 1

' if we have the correct record count, check the other stats
If (Recordset1_total <> -1) Then
If (Recordset1_first > Recordset1_total) Then Recordset1_first
= Recordset1_total
If (Recordset1_last > Recordset1_total) Then Recordset1_last =
Recordset1_total
If (Recordset1_numRows > Recordset1_total) Then
Recordset1_numRows = Recordset1_total
End If
%>
<%
' *** Recordset Stats: if we don't know the record count,
manually count them

If (Recordset1_total = -1) Then

' count the total records by iterating through the recordset
Recordset1_total=0
While (Not Recordset1.EOF)
Recordset1_total = Recordset1_total + 1
Recordset1.MoveNext
Wend

' reset the cursor to the beginning
If (Recordset1.CursorType > 0) Then
Recordset1.MoveFirst
Else
Recordset1.Requery
End If

' set the number of rows displayed on this page
If (Recordset1_numRows < 0 Or Recordset1_numRows >
Recordset1_total) Then
Recordset1_numRows = Recordset1_total
End If

' set the first and last displayed record
Recordset1_first = 1
Recordset1_last = Recordset1_first + Recordset1_numRows - 1
If (Recordset1_first > Recordset1_total) Then Recordset1_first
= Recordset1_total
If (Recordset1_last > Recordset1_total) Then Recordset1_last =
Recordset1_total

End If
%>
<HTML>.......

--
Dette indlæg er sendt fra http://www.html.dk
* Søg og læs i de danske nyhedsgrupper om webdesign
* Tutorials og artikler om webdesign på dansk

 
 
Lauritz Jensen (24-05-2001)
Kommentar
Fra : Lauritz Jensen


Dato : 24-05-01 15:28

"Møller" wrote:
>
> Jeg få denne meddelelse på siden
> Operation is not allowed on an object referencing a closed or
> invalid connection.
>
> /moller06/result.asp, line 17
>
> Her kommer koden altså, hvis det hjælper... Jeg er meget grøn i
> dette her... så være så venlig at hjælpe mig.

Det er ikke helt nemt at se, ud af det du har postet, hvilken en af
linierne, der er linie nummer 17. Men prøv at åbne og lukke din
connection og recordset sådan (måske er det på tide at vi får lavet en
faq for denne gruppe?):

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & _
"DBQ=" & Server.MapPath ("\moller06\db\db1.mdb")
Set Rs = Server.CreateObject("ADODB.Recordset")

....
Sql = ...
Rs.Open Sql, Conn, 0, 1, 1
....
Rs.Close
....

Set Rs = Nothing
Conn.Close
Set Conn = Nothing

--
Lauritz

Søg
Reklame
Statistik
Spørgsmål : 177510
Tips : 31968
Nyheder : 719565
Indlæg : 6408587
Brugere : 218887

Månedens bedste
Årets bedste
Sidste års bedste