---
title: "paging"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/14094-paging"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "Cactuz"
published: "2002-01-30T15:33:00.000Z"
updated: "2002-01-30T15:52:00.000Z"
replies: 3
views: 206
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/14094-paging"
---

# paging

## #1 — Cactuz, 2002-01-30T15:33Z

Jag använder 

```
<%
Set objRs = Server.Createobject("Adodb.Recordset")
strSQL = "Select * from anvandare Order by id asc"

strConString = "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" &_
  Server.MapPath("/") & "/db/users.mdb"

intPageId = request.querystring( "pageid" )
if intPageId = "" then intPageId = 1

with objRs
  .cursorlocation = 3 'adUseClient
  .open strSQL, strConString 'öppnar databasen och hämtar info.
  .pagesize = 10 'bestämmer hur många poster per sida.
  .absolutepage = intPageId 'bestämmer vilken sida som skall visas.
end with

intPages = cint( objRs.pagecount ) 'Kollar hur många sidor som finns i recordsettet.
intCurrentPost = 0 'Nollställer räknaren som skall hålla kolla på vilken post vi är på.

do while not objRs.eof and intCurrentPost < objRs.pagesize
  strContents = strContents &_
    "<tr><td>" & objRs( "Namn" ) & "</td>" &_
    "<td>" & objRs( "Alder" ) & "</td></tr>"
  intCurrentPost = intCurrentPost + 1
  objRs.MoveNext
loop

function getFirstLink()
  getFirstLink = " <a href='?pageid=1'>Första sidan</a> "
end function

function getPreviousLink( intPageId )
  if intPageId > 1 then
    getPreviousLink = " <a href='?pageid=" & intPageId - 1 & "'><< Föregående</a> "
  end if
end function

for i = 1 to objRs.pagecount
  strNavigation = strNavigation & " <a href='?pageid=" & i & "'>" & i & "</a>"
next

function getNextLink( intPageId, intPageCount )
  if cint( intPageId ) < cint( intPageCount ) then
    getNextLink = " <a href='?pageid=" & intPageId + 1 & "'>Nästa >></a> "
  end if
end function

function getLastLink( intPageCount )
  getLastLink = " <a href='?pageid=" & intPageCount & "'>Sista sidan</a> "
end function

function getPageInfo( intPageId, intPageCount )
  getPageInfo = " Antal sidor: " & intPageCount & ", nuvarande sida: " & intPageId & " "
end function

response.write "<table>" & strContents & "</table>"
response.write "<table><tr><td>" & getFirstLink & " " & getPreviousLink & " " & strNavigation & " " & getNextLink & " " & getLastLink & " " & getPageInfo & "</td></tr></table>" 

%>
```

o får felmeddelandet

> Körningsfel i Microsoft VBScript (0x800A01C2)
> Fel antal argument eller felaktig egenskapstilldelning.: 'getPreviousLink'

\[Redigerat av Cactuz den 30 jan 2002\]

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

## #2 — PatrikB, 2002-01-30T15:44Z

Du "passar" inte med några argument till dina funktioner:

```
response.write "<table><tr><td>" & getFirstLink & " " & getPreviousLink & " " & strNavigation & " " & getNextLink & " " & getLastLink & " " & getPageInfo & "</td></tr></table>"
```

"Passa" in de variabler som varje funktion behöver.

cya,
PatrikB

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

## #3 — LarsG, 2002-01-30T15:46Z

Du har inga parametrar med i funktionsanropen

```
response.write "<table><tr><td>" & getFirstLink() & " " & getPreviousLink(intPageId) & " " & strNavigation & " " & getNextLink(intPageId, intPages) & " " & getLastLink(intPages) & " " & getPageInfo(intPageId, intPages) & "</td></tr></table>"
```

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

## #4 — Cactuz, 2002-01-30T15:52Z

najs lars.. nu funkar det fint :)

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

---

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