---
title: "Paging"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/57369-paging"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "nille99"
published: "2002-10-29T09:58:09.000Z"
updated: "2002-10-29T10:23:33.000Z"
replies: 4
views: 240
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/57369-paging"
---

# Paging

## #1 — nille99, 2002-10-29T09:58Z

jag får problem med Paging

jag får felmedelandet 

Microsoft VBScript compilation error '800a0400' 

Expected statement 

 line 32 

With RecSet
  .CursorLocation = 3
  .CacheSize = perSida 
End With

Min kod ser ut 

Dim funktion
Funktion = dbkoppling

  Dim objCommand, objRS
   Dim connect, RecSet
  
const perSida = 20
Sidan = Request.QueryString("sida")
If Sidan = "" then 
sida = 1 
Else 
sida = Sidan 

End If 

With RecSet
  .CursorLocation = 3
  .CacheSize = perSida 
End With
 
Set RecSet = Server.CreateObject("ADODB.Recordset")

Addera = "Select \* From inlogningar"
RecSet.Open Addera, Connect, adOpenStatic, adLockOptimistic
%\>

**start table
meny rad** 

With RecSet
  .MoveFirst 
  .PageSize = perSida 
  .AbsolutePage = sida
End With

Sidor =  RecSet.PageCount

Count = 0 

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

**Utskrift**
    
Count = Count + 1
  RecSet.MoveNext
Loop
 ' Wend 
  RecSet.Close
  Set RecSet = Nothing
  %\>
      \</TABLE\>
\<%

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

\<%End If%\>

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

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

\</td\>
  \</tr\>
\</table\>

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

## #2 — @nders, 2002-10-29T10:01Z

1) använd \[kod\]-taggar så blir det lättare att läsa din kod.
2) Du kan ha en för gammal version av scriptmotorn, där inte With-statementet finns. Prova att skriva om det utan with.

mvh,

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

## #3 — nille99, 2002-10-29T10:06Z

hur skriver jag utan with?

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

## #4 — Ekström, 2002-10-29T10:14Z

```
RecSet.MoveFirst 
RecSet.PageSize = perSida 
RecSet.AbsolutePage = sida
```

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

## #5 — nille99, 2002-10-29T10:23Z

tack det fungerade

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

---

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