---
title: "ADODB.Field"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/39877-adodb-field"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "Asa"
published: "2002-03-18T16:51:25.000Z"
updated: "2002-03-18T18:30:27.000Z"
replies: 9
views: 192
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/asp/39877-adodb-field"
---

# ADODB.Field

## #1 — Asa, 2002-03-18T16:51Z

Vad är fel med denna eftersom detta felmeddelande kommer när man är på sista sidan?? Hoppas någon vet!

ADODB.Field error '80020009' 

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record. 

/gastbokstjanst/gastbok.asp, line 0 

\[kod\]
\<%Set Conn = Server.CreateObject("ADODB.Connection")
Set RecSet = Server.Createobject("ADODB.Recordset")
Conn.Open "Driver=Microsoft Access Driver (\*.mdb);DBQ=" & Server.MapPath("db/databas.mdb")

Const perSida = 10
Sidan = Request.QueryString("sida")
If Sidan = "" then 
   sida = 1 
Else 
   sida = Sidan 
End If 

RecSet.CursorLocation = 3
RecSet.CacheSize = perSida

SQL = "Select anvandare.\*, gastbok.\* From anvandare Left Join gastbok On anvandare.id = gastbok.anvId Where anvandare.id=" & Request.QueryString("id") & " Order By gastbok.id desc"
RecSet.Open SQL , Conn%\>

\<!--#include file="delaText.asp" --\>

\<html\>
\<head\>
\<title\>\<%=RecSet("titel")%\>\</title\>
\<style type="text/css"\>
\<!--
a:link        {color: \<%=RecSet("link")%\>; text-decoration: none}
a:visited   {color: \<%=RecSet("vlink")%\>; text-decoration: none}
a:active   {color: \<%=RecSet("alink")%\>; text-decoration: none}
a:hover     {color: \<%=RecSet("hover")%\>; text-decoration: underline}

body          {letter-spacing:0.05em; font-family:\<%=RecSet("typsnitt")%\>; font-size:\<%=RecSet("textstorlek")%\>; color:\<%=RecSet("textfarg")%\> }

table          {letter-spacing:0.05em; font-family:\<%=RecSet("typsnitt")%\>; font-size:\<%=RecSet("textstorlek")%\>}
tr               {letter-spacing:0.05em; font-family:\<%=RecSet("typsnitt")%\>; font-size:\<%=RecSet("textstorlek")%\>}
td               {letter-spacing:0.05em; font-family:\<%=RecSet("typsnitt")%\>; font-size:\<%=RecSet("textstorlek")%\>}
form          {font-family:\<%=RecSet("typsnitt")%\>; font-size:\<%=RecSet("textstorlek")%\>; font-weight:bold; letter-spacing:0.05em; border-width: 1px ; border-color: Black; background-color:\<%=RecSet("formbg")%\>}
input         {font-family:\<%=RecSet("typsnitt")%\>; font-size:\<%=RecSet("textstorlek")%\>; font-weight:bold; letter-spacing:0.05em; border-width: 1px ; border-color: Black; background-color:\<%=RecSet("formbg")%\>}
textarea    {font-family:\<%=RecSet("typsnitt")%\>; font-size:\<%=RecSet("textstorlek")%\>; font-weight:bold; letter-spacing:0.05em; border-width: 1px ; border-color: Black; background-color:\<%=RecSet("formbg")%\>}
select        {font-family:\<%=RecSet("typsnitt")%\>; font-size:\<%=RecSet("textstorlek")%\>; font-weight:bold; letter-spacing:0.05em; border-width: 1px ; border-color: Black; background-color:\<%=RecSet("formbg")%\>}
img            {border-color="#000000"} 

.rubrik       {letter-spacing:0.05em; font-family:\<%=RecSet("typsnitt")%\>; font-size:\<%=RecSet("rubrikstorlek")%\>}

\--\>
\</style\>
\<script src="js/gastbok.js"\>\</script\>
\</head\>

\<body bgcolor="\<%=RecSet("bg")%\>" background="\<%=RecSet("background")%\>"\>

\<table border="0" width="\<%=RecSet("bredd")%\>" align="\<%=RecSet("align")%\>"\>
  \<form method="post" action="gastbok.asp?do=add&id=\<%=Request.QueryString("id")%\>" name="gastbok" onSubmit="return kolla()"\>
    \<tr\> 
      \<td class="rubrik"\>\<b\>\<%=RecSet("rubrik")%\>\</b\>\</td\>\<td class="rubrik" align="right"\>\<b\>\<a href="\<%=RecSet("hemsidan")%\>" target="\<%=RecSet("target")%\>"\>\<%=RecSet("hem")%\>\</a\>\</b\>\</td\>
    \</tr\>
  \<tr\>
    \<td colspan="2"\>\<hr color="\<%=RecSet("color")%\>" noshade\>\</td\>
  \</tr\>
  \<tr\>
    \<td colspan="2"\>
\<table border="0" width="350"\>
    \<tr\> 
      \<td\>\<b\>\<%=RecSet("ntext")%\>\</b\>\<br\>\<input type="text" name="namn" size="\<%=RecSet("nbredd")%\>"\>\</td\>
      \<td\>\<b\>\<%=RecSet("etext")%\>\</b\>\<br\>\<input type="text" name="email" size="\<%=RecSet("ebredd")%\>"\>
      \</td\>
    \</tr\>
    \<tr\> 
      \<td\>\<b\>\<%=RecSet("htext")%\>\<br\>\<input type="text" name="hemsida" size="\<%=RecSet("hbredd")%\>"\>\</td\>
      \<td\>\<b\>\<%=RecSet("itext")%\>\</b\>\<br\>\<input type="text" name="icq" size="\<%=RecSet("ibredd")%\>"\>\</td\>
    \</tr\>
    \<tr\> 
      \<td colspan="2"\>\<b\>\<%=RecSet("ttext")%\>\</b\>\<br\>\<textarea name="inlagg" cols="\<%=RecSet("tbredd")%\>" rows="\<%=RecSet("thojd")%\>"\>\</textarea\>\<input type="hidden" name="ip" value="\<%=Request.Servervariables("REMOTE_ADDR")%\>"\>
      \</td\>
    \</tr\>
    \</table\>
    \</td\>
  \</tr\>
  \<tr\>
    \<td colspan="2"\>\<hr color="\<%=RecSet("color")%\>" noshade\>\</td\>
  \</tr\>
    \<tr\> 
      \<td colspan="2"\>\<input type="submit" name="submit" value="\<%=RecSet("knapp")%\>"\>\</td\>
    \</tr\>
  \</form\>
  \<tr\>
    \<td colspan="2"\>\<hr color="\<%=RecSet("color")%\>" noshade\>\</td\>
  \</tr\>
  \<tr\>
    \<td colspan="2" class="rubrik"\>\<b\>\<%=RecSet("inlaggIgastbok")%\> \</b\>\</td\>
  \</tr\>
  \<tr\>
    \<td colspan="2"\>\<hr color="\<%=RecSet("color")%\>" noshade\>\</td\>
  \</tr\>

\<%If RecSet.EOF Then
Response.Write "\<tr\>\<td colspan='2'\>" & RecSet("ingainlagg") & "\</td\>\</tr\>"
Else

RecSet.MoveFirst 
RecSet.PageSize = perSida

Sidor = RecSet.PageCount 
RecSet.AbsolutePage = sida

X = 0 
Do While Not RecSet.EOF And X \< RecSet.PageSize 

                    If RecSet("email") \<\> "" Then
                       Response.Write "\<tr\>\<td colspan='2'\>\<b\>" & FormatDateTime(RecSet("datum"),2) & " \| \<b\>\<a href='mailto:" & RecSet("email") & "'\>" & RecSet("namn") & "\</a\>\</b\>\</td\>\</tr\>"
                    Else
                       Response.Write "\<tr\>\<td colspan='2'\>\<b\>" & FormatDateTime(RecSet("datum"),2) & " \| \<b\>" & RecSet("namn") & "\</b\>\</td\>\</tr\>"
                    End If
                    Response.Write "\<tr\>\<td colspan='2'\>" & DelaText(RecSet("inlagg")) & "\</td\>\</tr\>"
                    Response.Write "\<tr\>\<td colspan='2'\>\<b\>"
                    If RecSet("hemsida") \<\> "" Then
                        Response.Write "\<a href='" & RecSet("hemsida") & "' target=\_blank\>" & RecSet("linkhemsida") & "\</a\> &nbsp; "
                    End If
                    If RecSet("icq") \<\> "" Then
                        Response.Write "\<a href='http://wwp.icq.com/scripts/search.dll?to=" & RecSet("icq") & "'\>" & RecSet("linkicq") & "\</a\>"
                    End If
                    Response.Write  "\</b\>\</td\>\</tr\>"
                    Response.Write "\<tr\>\<td colspan='2'\>\<hr color='" & RecSet("color") & "' noshade\>\</td\>\</tr\>"
X=X + 1
RecSet.MoveNext
Loop

End If%\>

\<tr\>
  \<td colspan="2"\>

\<%If Sidor \<\> 1 Then%\>

\<%If (Int(sida)) \<\> 1 Then%\>
\<a href="gastbok.asp?id=\<%=Request.QueryString("id")%\>&sida=\<%=(Int(sida)-1)%\>"\>\<b\>\<%=RecSet("bak")%\>\</b\>\</a\>
\<%Else%\>
\<%End If%\>

\<%For Sid = 1 To Sidor%\>
\<%If (Int(Sid)) = (Int(sida)) Then%\>\<%=Sid%\>\<%Else%\> \<a href="gastbok.asp?id=\<%=Request.QueryString("id")%\>&sida=\<%=Sid%\>"\>\<%=Sid%\>\</a\> \<%End If%\>
\<%Next%\> 

\<%If (Int(sida)) \<\> (Int(Sidor)) Then%\>
\<a href="gastbok.asp?id=\<%=Request.QueryString("id")%\>&sida=\<%=(Int(sida)+1)%\>"\>\<b\>\<%=RecSet("fram")%\>\</b\>\</a\>
\<%Else%\>
\<%End If%\>

\<%End If%\> 

  \</td\>
\</tr\>
  \<tr\>
    \<td colspan="2"\>\<hr color="\<%=RecSet("color")%\>" noshade\>\</td\>
  \</tr\>
\<%Set XX=Conn.Execute("Select Count(\*) As Tot From gastbok Where anvid=" & Request.QueryString("id"))

Response.Write "\<tr\>\<td colspan='2'\>\<b\>\<i\>" & RecSet("antalinlagg") & " " & XX("Tot") & "\</i\>\</td\>\</tr\>"
Response.Write "\<tr\>\<td colspan='2'\>\<hr color=" & RecSet("color") & " noshade\>\</td\>\</tr\>"
Response.Write "\<tr\>\<td colspan='2'\>\<b\>"
Response.Write "\<a href='" & Home & "index.asp?do=login'\>" & RecSet("andraGB") & "\</a\> &nbsp; \<a href='" & Home & "index.asp?do=regga' target=\_blank\>" & RecSet("skaffaGB") & "\</a\>"
Response.Write "\</b\>\</td\>\</tr\>\</table\>"%\>

\</body\>
\</html\>\[/od\]

Permalänk: https://www.webforum.nu/p/39877

## #2 — Jörgen HP, 2002-03-18T16:58Z

Hej,

det finns ingen post i databasen som matchar dina kriterier i sql-frågan.

Permalänk: https://www.webforum.nu/p/625472

## #3 — Asa, 2002-03-18T17:04Z

Men varför står det rad 0?? 

I andra script när jag använder sidnavigeringen så funkar det ju!

Permalänk: https://www.webforum.nu/p/625476

## #4 — LarsG, 2002-03-18T17:06Z

I det här kodavsnittet som ligger efter din loop så kan du ha fått eof på recsetet

```
<%If Sidor <> 1 Then%> 

<%If (Int(sida)) <> 1 Then%> 
<a href="gastbok.asp?id=<%=Request.QueryString("id")%>&sida=<%=(Int(sida)-1)%>"><b><%=RecSet("bak")%></b></a> 
<%Else%> 
<%End If%> 

<%For Sid = 1 To Sidor%> 
<%If (Int(Sid)) = (Int(sida)) Then%><%=Sid%><%Else%> <a href="gastbok.asp?id=<%=Request.QueryString("id")%>&sida=<%=Sid%>"><%=Sid%></a> <%End If%> 
<%Next%> 

<%If (Int(sida)) <> (Int(Sidor)) Then%> 
<a href="gastbok.asp?id=<%=Request.QueryString("id")%>&sida=<%=(Int(sida)+1)%>"><b><%=RecSet("fram")%></b></a> 
<%Else%> 
<%End If%> 

<%End If%> 

</td> 
</tr> 
<tr> 
<td colspan="2"><hr color="<%=RecSet("color")%>" noshade></td>
```

Permalänk: https://www.webforum.nu/p/625478

## #5 — Asa, 2002-03-18T17:12Z

Okej - ska kolla!

Permalänk: https://www.webforum.nu/p/625482

## #6 — Asa, 2002-03-18T17:14Z

Hmmm - hur ska jag då skriva? Gjorde om till denna kod från att jag använt GetRows så då spelade det ju ingen roll! Eller?

Hoppas nån kan och vill!  :)

Permalänk: https://www.webforum.nu/p/625484

## #7 — solbulle, 2002-03-18T17:18Z

Tycker detta påminner om en fråga som var uppe tidigare idag: 
<http://webforum.aleborg.com/forum/showthread.php?s=&threadid=39012>

Do While Not RecSet.EOF And X \< RecSet.PageSize 

kanske ska vara:

Do While Not RecSet.EOF OR X \< RecSet.PageSize 

....

Permalänk: https://www.webforum.nu/p/625485

## #8 — Asa, 2002-03-18T17:27Z

Nope - men jag fick stänga recordsettet efter loopen och öppna det igen - då funkade det! Tacka för alla svar!

Permalänk: https://www.webforum.nu/p/625488

## #9 — solbulle, 2002-03-18T18:06Z

dÅ BORDE DU VÄL KUNNA KÖRA EN RecSet.MoveFirst efter loopen istället.

hupp caps...

Permalänk: https://www.webforum.nu/p/625498

## #10 — Asa, 2002-03-18T18:30Z

Funkade fint!

Permalänk: https://www.webforum.nu/p/625503

---

Tråden på webben: https://www.webforum.nu/amne/asp/39877-adodb-field
