webForumDet fria alternativet

HTTP 500 Internt Server FEL

ASPur ASP

1 svar · 131 visningar · startad av fredrik99

Medlem sedan maj 2000426 inlägg
Frågan#1

Någon som vet varför jag får HTTP 500 Internt Server fel med denna kod:

<html>

<head>
<link rel=stylesheet href="stilar.css" TYPE="text/css">
<title></title>

</head>
<%
mypage = Request("sida")
If mypage = "" then
   mypage = 1
End If
mypagesize = 10

Set Connection = Server.Createobject("ADODB.Connection")
Connection.Open "ringsjo.nu-databas"

SQLStmt = "SELECT Count(*) AS Antal From Gastbok"
Set RS = Connection.Execute(SQLStmt)

SQL = "SELECT *, Format$([datum],'yyyy/mm/dd hh:mm') AS formdatum FROM Gastbok Order by Id desc"
Set rstemp = Server.Createobject("ADODB.Recordset")

rstemp.cursorlocation = 3
rstemp.cachesize = 5
rstemp.open SQL, "ringsjo.nu-databas"
If rstemp.EOF then
   Response.write "Tyvär inga som skrivit här än " & sok
Else
   rstemp.movefirst
   rstemp.pagesize = mypagesize
   maxcount = Cint(rstemp.pagecount)
   rstemp.absolutepage = mypage
   howmanyrecs = 0
   howmanyfields = rstemp.fields.count -1
   Do While Not RStemp.EOF AND howmanyrecs < rstemp.pagesize
   counter = counter + 1
   If counter mod 2 = 0 then
      color = "CCCC99"
   Else
      color = "CCCC66"
   End If
%>
<table border="0">
<tr>
<td>Namn:</td>
<td><a href="mailto:<%= RStemp("epost")%>"><%= RStemp("Namn")%></a></td>
</tr>
<tr>
<td>Datum:</td>
<td><%= RStemp("FormDatum")%></td>
</tr>
<tr>
<td>Inlägg:</td>
<td><%= RStemp("Inlagg")%></td>
</tr>
<br>
   <%
   rstemp.movenext
   howmanyrecs = howmanyrecs + 1
   Loop
   rstemp.close
   Set rstemp = nothing
   %>
</table>
<br><br>
Antal inlägg: <%=RS("antal")%><br><br>
   <%
   If maxcount <> 0 then
   response.write "Sida " & mypage & " av " & maxcount & "<br>" & "Sidor: "
   pad = "0"
   scriptname = request.Servervariables("script_name")
   for counter = 1 to maxcount
   If counter > 10 then
      pad = ""
   End If
   ref = "<a href='" & scriptname & "?sida=" & counter & "&antal=" & mypagesize & "'>" & pad & counter & "</a> "
   response.write ref & " "
   if counter mod 10 = 0 then
      response.write "<br>"
   End If
   Next
   End If
End If
%>
<br><br>

</html>
<% 
RS.Close
Connection.Close
%>

[Redigerat av fredrik99 den 22 sep 2000]

Medlem sedan mars 2000263 inlägg
#2

ändra
rstemp.open SQL, "ringsjo.nu-databas"
till
rstemp.open SQL, connection

------------------
/bohlin
kaffe är djävulens dryck
glögg är guds dryck

128 ms totalt · 3 externa anrop · v20260731065814-full.25f56b17
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
126 ms — hämta tråd, inlägg och bilagor (db)