WebbisNetMedlem sedan feb. 20032 182 inlägg
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 & "'><< Föregående</a> "
else
If intp < 2 then
response.write "<< 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
WebbisNetMedlem sedan feb. 20032 182 inlägg
magnusfernstrom skrev:
Och rad 38 är?
Den rad som står i felmeddelandet förstås
magnusfernstromMedlem sedan mars 20032 184 inlägg
Jesper TMedlem sedan nov. 20017 058 inlägg
Testa detta:
function getPreviousLink(intp)
if intp > 1 then
getPreviousLink = " <a href='/search/?do=query&type=username&p=" & intp - 1 & "'><< Föregående</a> "
else
If intp < 2 then
getPreviousLink = "<< Föregående"
end if
end if
end function
Godnatt pöjkar.
WebbisNetMedlem sedan feb. 20032 182 inlägg
Jesper T skrev:
Testa detta:
function getPreviousLink(intp)
if intp > 1 then
getPreviousLink = " <a href='/search/?do=query&type=username&p=" & intp - 1 & "'><< Föregående</a> "
else
If intp < 2 then
getPreviousLink = "<< Föregående"
end if
end if
end function
Godnatt pöjkar.
Samma fel
Jesper TMedlem sedan nov. 20017 058 inlägg
function getPreviousLink(intp)
if intp > 1 then
getPreviousLink = " <a href='/search/?do=query&type=username&p=" & intp - 1 & "'><< Föregående</a> "
elseif intp < 2 then
getPreviousLink = "<< 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
WebbisNetMedlem sedan feb. 20032 182 inlägg
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 & "'><< Föregående</a> "
elseif intp < 2 then
getPreviousLink = "<< 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 >></a> "
else
if cint( intp ) = cint( intPageCount ) then
getNextLink = " Nästa >></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
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 & "'><< Föregående</a> "
elseif intp < 2 then
getPreviousLink = "<< 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 >></a> "
else
if cint( intp ) = cint( intPageCount ) then
getNextLink = " Nästa >></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*