webForumDet fria alternativet

If sats felsökning

ASP

0 svar · 127 visningar · startad av Meng

Medlem sedan feb. 2003549 inlägg
Frågan#1

Nu sitter jag o leta ihjäl mig efter ett fel, jag försöker göra 4-5 sidora till en i asp och när jag gjort detta så blir sida nummer 2 helt blank, utan fel mess eller något. Det jag har gjort nytt är "action" = "dato" och den blir helt tom jämfört med "action" = ""

Nån som kanske kan se felet jag inte ser?

<%If Request.Querystring("action")= "" AND Session("nyhet") = Secure Then%>

	 <table border="0" width="100%" cellspacing="0" cellpadding="0">

	<%Set RecSet = Server.CreateObject("ADODB.Recordset")

	Const perSida1 = 300
	Sidan = Request.QueryString("sida")
	If Sidan = "" then 
	    sida = 1 
	Else 
	    sida = Sidan 
	End If 

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

	SQL = "SELECT * FROM opgave WHERE status <> '4' ORDER BY prioritet DESC"
	RecSet.Open SQL, Conn

	If RecSet.EOF Then%>

	  <tr>
	    <td height="14">Inge Opgaver</td>
	  </tr>
	</table>

	<%Else%>
	  <tr height="20">
	    <td align="left" width="25">  <b></b></td>
	    <td align="left" width="200"> <b>Opgave</b></td>
	    <td align="left" width="100"> <b><a href="opgave2.asp?do=dato" style="color: #000000">Tilføjet</b></td>
	    <td align="left" width="60">  <b><a href="opgavetil.asp" style="color: #000000">Til</b></td>
	    <td align="left" width="60">  <b>Hvem</b></td>
	    <td align="left" width="60">  <b>Placering</b></td>
	    <td align="left" width="150"> <b>Deadline</b></td>
	    <td align="center" width="50"><b><a href="opgave2.asp" style="color: #000000">Prioritet</a></b></td>
	    <td align="center" width="40"><b><a href="opgaves.asp" style="color: #000000">Status</a></b></td>
	    <td align="right" width="50"></td>
	  </tr>
	  <tr height="1">
	<td colspan="10" background="../../include/images/bg_hr2.gif"></td>
	  </tr>
	<%With RecSet
	     .MoveFirst 
	     .PageSize = perSida1 
	     .AbsolutePage = sida
	End With

	Sidor =  RecSet.PageCount
	Count = 0 
	Do While Not RecSet.EOF And Count < RecSet.PageSize%>
	<%
	 If Year(RecSet("datum")) = Year(Date) And Month(RecSet("datum")) = Month(Date) And Day(RecSet("datum")) = Day(Date) Then
	  strColor = "#FF3939"
	Else
	  strColor = "#000000"
	End If
	%>

	  <tr height="20">
	    <td align="left" width="25"><img src="bilder/ico_<%=RecSet("iconid")%>.gif" width="15" height="15"></td>
	    <td align="left" width="200"><b><a href="opgave.asp?ID=<%=RecSet("ID")%>" style="color:<%=strColor%>"><%If Len(RecSet("opgave")) > 33 Then%><%=Left(RecSet("opgave"),33)%>...<%Else%><%=RecSet("opgave")%><%End If%></a></b></td>
	    <td align="left" width="100"><%response.write Day(recset("datum")) & " " & Monthname(Month(recset("datum")),true) & " (" & formatdatetime(recset("datum"),4) & ")"%></td>
	    <td align="left" width="60"><%=RecSet("til")%></td>
	    <td align="left" width="60"><%If Len(RecSet("vem")) > 6 Then%><%=Left(RecSet("vem"),6)%>...<%Else%><%=RecSet("vem")%><%End If%></td>
	    <td align="left" width="60"><%If Len(RecSet("placering")) > 5 Then%><%=Left(RecSet("placering"),5)%>...<%Else%><%=RecSet("placering")%><%End If%></td>
	    <td align="left" width="150"><%If Len(RecSet("info2")) > 20 Then%><%=Left(RecSet("info2"),20)%>...<%Else%><%=RecSet("info2")%><%End If%></td>
	    <td align="center" valign="middle" width="50"><img src="bilder/prioritet_<%=RecSet("prioritet")%>.gif" width="26" height="7"></td>
	    <td align="center" width="40"><img src="bilder/status_<%=RecSet("status")%>.gif" width="17" height="17"></td>
	    <td align="right" width="50"><%If RecSet("bild") <> "" Then%> <a href="opgave2.asp?do=inne&action=delbild&id=<%=RecSet("id")%>&bild=<%=Mid(RecSet("bild"),9)%>" onClick="return confirm('Vill du verkligen ta bort bilden <%=Mid(RecSet("bild"),9)%>?');"></a><%Else%> <a href="opgave2.asp?do=inne&action=new&id=<%=RecSet("id")%>"></a><%End If%> &nbsp;<a href="opgave2.asp?do=inne&action=change&id=<%=RecSet("id")%>" title="Ändra"><img src="bilder/update.gif" border="0" alt="Ændre nyheden?"></a> &nbsp;<a href="opgave2.asp?do=inne&action=delete&id=<%=RecSet("id")%>&bild=<%=Mid(RecSet("bild"),9)%>" title="Fjern" onClick="return confirm('Fjerne <%=RecSet("opgave")%>?');"><img src="bilder/trash.gif" border="0" alt="Fjern nyheden?"></a></td>
	  </tr>
			
	<%Count = Count + 1
	RecSet.MoveNext
	Loop

	If Sidor > 1 Then%>
	     <tr height="1">
	        <td colspan="10" height="1" background="../images/bg_hr2.gif"></td>
	     </tr>
	     <tr>
	        <td colspan="10"><b>
	     <%If Sidor <> 1 Then
	     For Sid = 1 To Sidor
	     If (Int(Sid)) = (Int(sida)) Then%><font color="#ff0000"><%=Sid%></font><%Else%> <a href="opgave2.asp?do=inne&sida=<%=Sid%>"><%=Sid%></a> <%End If%>
	     <%Next%></b></font>
	        </td>
	     </tr>
	
<%End If
End If%>

     <%If Session("mess") <> "" Then%>
     <tr>
        <td colspan="10" align="center" style="border-top: 1px solid #000000"><b>
     <%
       Response.Write Session("mess")
       Session("mess") = ""
     %></b>
       </td>
     </tr>
     <%End If%>

</table>

<%RecSet.Close
Set RecSet = Nothing
End If
End If
If Request.Querystring("action") = "dato" AND Session("nyhet") = Secure Then%>

	 <table border="0" width="100%" cellspacing="0" cellpadding="0">

	<%

	SQL = "SELECT * FROM opgave WHERE status <> '4' ORDER BY datum"
	RecSet.Open SQL, Conn

	If RecSet.EOF Then%>

	  <tr>
	    <td height="14">Inge Opgaver</td>
	  </tr>
	</table>

	<%Else%>
	  <tr height="20">
	    <td align="left" width="25">  <b></b></td>
	    <td align="left" width="200"> <b>Opgave</b></td>
	    <td align="left" width="100"> <b><a href="opgave2.asp?do=dato" style="color: #000000">Tilføjet</b></td>
	    <td align="left" width="60">  <b><a href="opgavetil.asp" style="color: #000000">Til</b></td>
	    <td align="left" width="60">  <b>Hvem</b></td>
	    <td align="left" width="60">  <b>Placering</b></td>
	    <td align="left" width="150"> <b>Deadline</b></td>
	    <td align="center" width="50"><b><a href="opgave2.asp" style="color: #000000">Prioritet</a></b></td>
	    <td align="center" width="40"><b><a href="opgaves.asp" style="color: #000000">Status</a></b></td>
	    <td align="right" width="50"></td>
	  </tr>
	  <tr height="1">
	<td colspan="10" background="../../include/images/bg_hr2.gif"></td>
	  </tr>
	<%With RecSet
	     .MoveFirst 
	     .PageSize = perSida1 
	     .AbsolutePage = sida
	End With

	Sidor =  RecSet.PageCount
	Count = 0 
	Do While Not RecSet.EOF And Count < RecSet.PageSize%>
	<%
	 If Year(RecSet("datum")) = Year(Date) And Month(RecSet("datum")) = Month(Date) And Day(RecSet("datum")) = Day(Date) Then
	  strColor = "#FF3939"
	Else
	  strColor = "#000000"
	End If
	%>

	  <tr height="20">
	    <td align="left" width="25"><img src="bilder/ico_<%=RecSet("iconid")%>.gif" width="15" height="15"></td>
	    <td align="left" width="200"><b><a href="opgave.asp?ID=<%=RecSet("ID")%>" style="color:<%=strColor%>"><%If Len(RecSet("opgave")) > 33 Then%><%=Left(RecSet("opgave"),33)%>...<%Else%><%=RecSet("opgave")%><%End If%></a></b></td>
	    <td align="left" width="100"><%response.write Day(recset("datum")) & " " & Monthname(Month(recset("datum")),true) & " (" & formatdatetime(recset("datum"),4) & ")"%></td>
	    <td align="left" width="60"><%=RecSet("til")%></td>
	    <td align="left" width="60"><%If Len(RecSet("vem")) > 6 Then%><%=Left(RecSet("vem"),6)%>...<%Else%><%=RecSet("vem")%><%End If%></td>
	    <td align="left" width="60"><%If Len(RecSet("placering")) > 5 Then%><%=Left(RecSet("placering"),5)%>...<%Else%><%=RecSet("placering")%><%End If%></td>
	    <td align="left" width="150"><%If Len(RecSet("info2")) > 20 Then%><%=Left(RecSet("info2"),20)%>...<%Else%><%=RecSet("info2")%><%End If%></td>
	    <td align="center" valign="middle" width="50"><img src="bilder/prioritet_<%=RecSet("prioritet")%>.gif" width="26" height="7"></td>
	    <td align="center" width="40"><img src="bilder/status_<%=RecSet("status")%>.gif" width="17" height="17"></td>
	    <td align="right" width="50"><%If RecSet("bild") <> "" Then%> <a href="opgave2.asp?do=inne&action=delbild&id=<%=RecSet("id")%>&bild=<%=Mid(RecSet("bild"),9)%>" onClick="return confirm('Vill du verkligen ta bort bilden <%=Mid(RecSet("bild"),9)%>?');"></a><%Else%> <a href="opgave2.asp?do=inne&action=new&id=<%=RecSet("id")%>"></a><%End If%> &nbsp;<a href="opgave2.asp?do=inne&action=change&id=<%=RecSet("id")%>" title="Ändra"><img src="bilder/update.gif" border="0" alt="Ændre nyheden?"></a> &nbsp;<a href="opgave2.asp?do=inne&action=delete&id=<%=RecSet("id")%>&bild=<%=Mid(RecSet("bild"),9)%>" title="Fjern" onClick="return confirm('Fjerne <%=RecSet("opgave")%>?');"><img src="bilder/trash.gif" border="0" alt="Fjern nyheden?"></a></td>
	  </tr>
			
	<%Count = Count + 1
	RecSet.MoveNext
	Loop

	If Sidor > 1 Then%>
	     <tr height="1">
	        <td colspan="10" height="1" background="../images/bg_hr2.gif"></td>
	     </tr>
	     <tr>
	        <td colspan="10"><b>
	     <%If Sidor <> 1 Then
	     For Sid = 1 To Sidor
	     If (Int(Sid)) = (Int(sida)) Then%><font color="#ff0000"><%=Sid%></font><%Else%> <a href="opgave2.asp?do=inne&sida=<%=Sid%>"><%=Sid%></a> <%End If%>
	     <%Next%></b></font>
	        </td>
	     </tr>
	
<%End If
End If%>

     <%If Session("mess") <> "" Then%>
     <tr>
        <td colspan="10" align="center" style="border-top: 1px solid #000000"><b>
     <%
       Response.Write Session("mess")
       Session("mess") = ""
     %></b>
       </td>
     </tr>
     <%End If%>

</table>

<%RecSet.Close
Set RecSet = Nothing
End If
End If%>
263 ms totalt · 4 externa anrop · v20260731065814-full.86ec41c2
121 ms — deklarationer (db)
0 ms — hämta statistik (cache)
134 ms — hämta tråd, inlägg och bilagor (db)
126 ms — ändringar (db)