webForumDet fria alternativet
Logga in / Bli medlem

Syntaxfel

ASP

9 svar · 258 visningar · startad av WebbisNet

Medlem sedan feb. 20032 027 inlägg
Trådstart#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)

Medlem sedan mars 20033 686 inlägg
#2

Och rad 38 är?

Medlem sedan feb. 20032 027 inlägg
#3

magnusfernstrom skrev:

Och rad 38 är?

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

Medlem sedan mars 20033 686 inlägg
#4

*host* Ah *host* :r

Medlem sedan nov. 20017 144 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.

Medlem sedan feb. 20032 027 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

Medlem sedan nov. 20017 144 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
Medlem sedan nov. 20017 144 inlägg
#8

Jag har tom testat. ;)

Medlem sedan feb. 20032 027 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%>
Medlem sedan feb. 20032 027 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*

309 ms totalt · 4 externa anrop · v20260731065814-full.51f67c91
117 ms — deklarationer (db)
0 ms — hämta statistik (cache)
135 ms — hämta tråd, inlägg och bilagor (db)
159 ms — ändringar (db)