webForumDet fria alternativet

Syntaxfel

9 svar · 258 visningar · startad av WebbisNet

WebbisNetMedlem sedan feb. 20032 182 inlägg
#1

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)

magnusfernstromMedlem sedan mars 20032 184 inlägg
#2

Och rad 38 är?

WebbisNetMedlem sedan feb. 20032 182 inlägg
#3

magnusfernstrom skrev:

Och rad 38 är?

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

magnusfernstromMedlem sedan mars 20032 184 inlägg
#4

*host* Ah *host* :r

Jesper TMedlem sedan nov. 20017 058 inlägg
#5

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.

WebbisNetMedlem sedan feb. 20032 182 inlägg
#6

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

Jesper TMedlem sedan nov. 20017 058 inlägg
#7
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
Jesper TMedlem sedan nov. 20017 058 inlägg
#8

Jag har tom testat. ;)

WebbisNetMedlem sedan feb. 20032 182 inlägg
#9

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%>
WebbisNetMedlem sedan feb. 20032 182 inlägg
#10

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*

Genererad på 377 ms · cache AV · v20260730165559-full.f96bc7eb