---
title: "Paging!"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/39945-paging"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "Asa"
published: "2002-03-19T16:22:39.000Z"
updated: "2002-03-19T18:34:26.000Z"
replies: 4
views: 405
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/39945-paging"
---

# Paging!

## #1 — Asa, 2002-03-19T16:22Z

Varför funkar inte gästbok nummer 152 och uppåt när jag använder denna kod??? Alltså ca 140 st fungerar men sen funkar det ej!

\<%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")

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

RecSet.CursorLocation = 3

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.PageSize = RecSet("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
RecSet.MoveFirst %\>

\<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\>

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

## #2 — PatrikB, 2002-03-19T16:30Z

ngt felmeddelande? beskriv vad det är som inte funkar så kanske vi kan hjälpa till att lösa problemet.

cya,
PatrikB

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

## #3 — Asa, 2002-03-19T16:32Z

Det blir inget felmeddelande utan gästboken syns inte alls!!

Denna syns:
<http://www.gruvsjo.com/gastbokstjanst/gastbok.asp?id=151>

Men inte denna:
<http://www.gruvsjo.com/gastbokstjanst/gastbok.asp?id=152>

Och den finns i databasen!!

Är det något i koden som hindrar den att hämta från databasen efter ca 140 poster!??

Om man tar bort **RecSet.CursorLocation = 3** så syns iallafall gästboken men då blir det felet:

ADODB.Recordset error '800a0cb3' 
Object or provider is not capable of performing requested operation. 

/gastbokstjanst/gastbok.asp, line 133 

Så jag tror det är nåt fel med pagingen fast det funkar på de andra gästböckerna!

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

## #4 — Morph, 2002-03-19T17:16Z

Jodå, det blir visst ett felmeddelande när id=152. Om du tar "visa källa" (view source) på den tomma sidan visar sig följande felmeddelande:

**error '80020009'
Data provider or other service returned an E_FAIL status.
/gastbokstjanst/gastbok.asp, line 0**

E_FAIL är en allmän ADODB-felkod. En sökning på MSDN gav vid handen att felet kan orsakas av att äldre ODBC drivrutiner för Access har problem med LEFT JOINS.

Fel av den här typen brukar rättas till om man laddar ner & installerar en ny MDAC från <http://www.microsoft.com/data.> Eventuellt kan du behöva installera den senaste versionen av Microsoft Jet också.

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

## #5 — Asa, 2002-03-19T18:34Z

Jag fick till det själv! Gjorde en öppning för tabellen användare och en för gästboken!

Du blev allt bra plus att jag fick ändra lite annat oxå!

Men tack för all hjälp!

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

---

Tråden på webben: https://www.webforum.nu/amne/asp/39945-paging
