---
title: "Syntaxfel"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/110473-syntaxfel"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "WebbisNet"
published: "2004-09-01T01:28:08.000Z"
updated: "2004-09-01T13:46:31.000Z"
replies: 9
views: 258
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/110473-syntaxfel"
---

# Syntaxfel

## #1 — WebbisNet, 2004-09-01T01:28Z

Kan nån se vad syntaxfelet är?

```
function getPreviousLink(intp)
  if intp > 1 then
    getPreviousLink = " <a href='/search/?do=query&type=username&p=" & intp - 1 & "'>&lt;&lt; Föregående</a> "
    else
        If intp < 2 then
              response.write "&lt;&lt; Föregående"
        end if  
  end if
end function
```

Kompileringsfel i Microsoft VBScript (0x800A03EA)
Syntaxfel
/search/userSearch.asp, line 38
function getPreviousLink(intp)

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

## #2 — magnusfernstrom, 2004-09-01T01:44Z

Och rad 38 är?

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

## #3 — WebbisNet, 2004-09-01T01:44Z

> **magnusfernstrom skrev:**
>
> Och rad 38 är?

Den rad som står i felmeddelandet förstås

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

## #4 — magnusfernstrom, 2004-09-01T01:45Z

\*host\* Ah \*host\*  :r

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

## #5 — Jesper T, 2004-09-01T02:03Z

Testa detta:

```
function getPreviousLink(intp)
  if intp > 1 then
    getPreviousLink = " <a href='/search/?do=query&type=username&p=" & intp - 1 & "'>&lt;&lt; Föregående</a> "
    else
        If intp < 2 then
              getPreviousLink = "&lt;&lt; Föregående"
        end if  
  end if
end function
```

Godnatt pöjkar.

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

## #6 — WebbisNet, 2004-09-01T02:06Z

> **Jesper T skrev:**
>
> Testa detta:
>
> ```
> function getPreviousLink(intp)
>   if intp > 1 then
>     getPreviousLink = " <a href='/search/?do=query&type=username&p=" & intp - 1 & "'>&lt;&lt; Föregående</a> "
>     else
>         If intp < 2 then
>               getPreviousLink = "&lt;&lt; Föregående"
>         end if  
>   end if
> end function
> ```
>
> Godnatt pöjkar.

Samma fel

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

## #7 — Jesper T, 2004-09-01T02:08Z

```
function getPreviousLink(intp)
    if intp > 1 then
        getPreviousLink = " <a href='/search/?do=query&type=username&p=" & intp - 1 & "'>&lt;&lt; Föregående</a> "
    elseif intp < 2 then
        getPreviousLink = "&lt;&lt; Föregående"
    end if
end function
					
response.write getPreviousLink(0)'Visar ingen länk
response.write getPreviousLink(2)'Visar länk
```

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

## #8 — Jesper T, 2004-09-01T02:09Z

Jag har tom testat. ;)

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

## #9 — WebbisNet, 2004-09-01T02:19Z

> **Jesper T skrev:**
>
> Jag har tom testat. ;)

Slänger in hela koden.....den pekar på det felet men det riktiga felet måste ligga nån annanstans

```
<%
Set sokRS = Server.Createobject("Adodb.Recordset")
sokRS = "Select * From tblUsers where username LIKE '%" & sokUsername & "%'" 
strConString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source= "& server.MapPath("/db/Inloggning.mdb") & ";"

'================================================================================================
function getPreviousLink(intp)
    if intp > 1 then
        getPreviousLink = " <a href='/search/?do=query&type=username&p=" & intp - 1 & "'>&lt;&lt; Föregående</a> "
    elseif intp < 2 then
        getPreviousLink = "&lt;&lt; Föregående"
    end if
end function

'================================================================================================

'================================================================================================
function getNextLink( intp, intPageCount )
  if not cint( intp ) < cint( intPageCount ) then
    getNextLink = " <a href='/search/?do=query&type=username&p=" & intp + 1 & "'> Nästa &gt;&gt;</a> "
        else
            if cint( intp ) = cint( intPageCount ) then
                getNextLink = " Nästa &gt;&gt;</a> "
           end if
  end if
end function
'================================================================================================

'================================================================================================
function getLastLink( intPageCount )
  getLastLink = " <a href='/search/?do=query&type=username&p=" & intPageCount & "'>Sista sidan</a> "
end function
'================================================================================================

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

intp = request.querystring( "p" )
if intp = "" then intp = 1

with sokRS
  .cursorlocation = 3
  .open strSQL, strConString
  .pagesize = 15
  .absolutepage = intp
end with

intPages = cint( sokRS.pagecount )
intCurrentPost = 0

do while not sokRS.eof and intCurrentPost < sokRS.pagesize
  strContents = strContents &_%>
    <tr>  
        <td>
		<a href="/mail/writeMail.asp?sender=<%=Session("userID")%>&reciever=<%=sokRS("userID")%>">
		<img border="0" title="Skicka meddelande till <%=sokRS("username")%>" <%=mail%>"></a>
		</td>
        <td>
		<a class="menu" href="/view.asp?userID=<%=sokRS("userID")%>"><%=sokRS("username")%> </a></td>
		<td><%alder=FormatNumber(DateDiff("y",sokRS("persnr") ,date())/365.2375,1)%>
		<%=alder%> år </td><td> från <%=sokRS("city")%> i <%=sokRS("Community")%>s län</td>
    </tr>
 <% intCurrentPost = intCurrentPost + 1
  sokRS.movenext
loop

for i = 1 to sokRS.pagecount
  strNavigation = strNavigation & " <a href='?do=query&type=username&p=" & i & "'>" & i & "</a>"
next
%>
<%=getPreviousLink( intp )%> <%=strNavigation%> <%=getNextLink( intp, intPageCount )%><hr>
<%=strContents%>
```

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

## #10 — WebbisNet, 2004-09-01T13:46Z

> **WebbisNet skrev:**
>
> > **Jesper T skrev:**
> >
> > Jag har tom testat. ;)
>
> 
> 
> Slänger in hela koden.....den pekar på det felet men det riktiga felet måste ligga nån annanstans
>
>
> ```
> <%
> Set sokRS = Server.Createobject("Adodb.Recordset")
> sokRS = "Select * From tblUsers where username LIKE '%" & sokUsername & "%'" 
> strConString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source= "& server.MapPath("/db/Inloggning.mdb") & ";"
> 
> 
> 
> '================================================================================================
> function getPreviousLink(intp)
>     if intp > 1 then
>         getPreviousLink = " <a href='/search/?do=query&type=username&p=" & intp - 1 & "'>&lt;&lt; Föregående</a> "
>     elseif intp < 2 then
>         getPreviousLink = "&lt;&lt; Föregående"
>     end if
> end function
> 
> '================================================================================================
> 
> '================================================================================================
> function getNextLink( intp, intPageCount )
>   if not cint( intp ) < cint( intPageCount ) then
>     getNextLink = " <a href='/search/?do=query&type=username&p=" & intp + 1 & "'> Nästa &gt;&gt;</a> "
>         else
>             if cint( intp ) = cint( intPageCount ) then
>                 getNextLink = " Nästa &gt;&gt;</a> "
>            end if
>   end if
> end function
> '================================================================================================
> 
> '================================================================================================
> function getLastLink( intPageCount )
>   getLastLink = " <a href='/search/?do=query&type=username&p=" & intPageCount & "'>Sista sidan</a> "
> end function
> '================================================================================================
> 
> '================================================================================================
> function getPageInfo( intp, intPageCount )
>   getPageInfo = " Antal sidor: " & intPageCount & ", nuvarande sida: " & intp & " "
> end function
> '================================================================================================
> 
> intp = request.querystring( "p" )
> if intp = "" then intp = 1
> 
> with sokRS
>   .cursorlocation = 3
>   .open strSQL, strConString
>   .pagesize = 15
>   .absolutepage = intp
> end with
> 
> intPages = cint( sokRS.pagecount )
> intCurrentPost = 0
> 
> 
> do while not sokRS.eof and intCurrentPost < sokRS.pagesize
>   strContents = strContents &_%>
>     <tr>  
>         <td>
> 		<a href="/mail/writeMail.asp?sender=<%=Session("userID")%>&reciever=<%=sokRS("userID")%>">
> 		<img border="0" title="Skicka meddelande till <%=sokRS("username")%>" <%=mail%>"></a>
> 		</td>
>         <td>
> 		<a class="menu" href="/view.asp?userID=<%=sokRS("userID")%>"><%=sokRS("username")%> </a></td>
> 		<td><%alder=FormatNumber(DateDiff("y",sokRS("persnr") ,date())/365.2375,1)%>
> 		<%=alder%> år </td><td> från <%=sokRS("city")%> i <%=sokRS("Community")%>s län</td>
>     </tr>
>  <% intCurrentPost = intCurrentPost + 1
>   sokRS.movenext
> loop
> 
> for i = 1 to sokRS.pagecount
>   strNavigation = strNavigation & " <a href='?do=query&type=username&p=" & i & "'>" & i & "</a>"
> next
> %>
> <%=getPreviousLink( intp )%> <%=strNavigation%> <%=getNextLink( intp, intPageCount )%><hr>
> <%=strContents%>
> ```

Felet här var att jag hade sokRS som RS och SQL \*skäms\*

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

---

Tråden på webben: https://www.webforum.nu/amne/asp/110473-syntaxfel
