Bifogade fel fil. Har nu löst det ändå.
Frågan#1
hmm.. När jag nu skall kolla "äldre" frågor på omröstningne får jag:
Microsoft VBScript runtime error '800a000d'
Type mismatch
/nyclub3/old_poll.asp, line 56
(Har markerat rad 56.)
<%Dim strVotedPoll
Set Check = Conn.Execute("SELECT votedPoll From com_users Where active=1 and userid=" & FixaTecken(Session("user_id")))
strVotedPoll = Check(0)
Check.Close:Set Check=Nothing
If Request.Querystring("action") = "" Then%>
<table cellpadding="2" cellspacing="0" border="0" width="100%" align="center">
<%Set Fraga=Conn.Execute("SELECT pollid,fraga From com_fraga Order by PollId desc limit 1")
If Fraga.EOF Then%>
<tr>
<td colspan="2"><%=strPoll_NoPost%></td>
</tr>
<%Else%>
<tr>
<td colspan="2"><b><%=Fraga(1)%></b></td>
</tr>
<%totalt = Conn.Execute("SELECT sum(klick) From com_svar Where pollID=" & FixaTecken(Fraga(0))).Fields(0)
SQL1 = "SELECT pollID,klick,svar,id From com_svar Where pollID="& FixaTecken(Fraga(0)) & " Order By svarnr"
arrRecSet = GetDbRows(SQL1)
If Not IsArray(arrRecSet) Then%>
<tr>
<td colspan="2"><b><%=strPoll_NoSvar%></b></td>
</tr>
<%Else
For i = 0 To ubound(arrRecSet,2)
stat = arrRecSet(1,i)
If stat <> 0 Then
res = (Clng(stat)/Clng(totalt))* 100
Else
res = "0"
End If
If Int(strVotedPoll) = Int(Fraga(0)) Then%>
<tr>
<td width="82%"><%=arrRecSet(2,i)%> (<%=stat%>)</td>
<td rowspan="2" width="18%" valign="bottom" align="right"><%=Round(res,0)%>%</td>
</tr>
<tr>
<td bgcolor="<%=sidBG%>" height="5"><img src="gfx/stapel.gif" width="<%=Round(res,0)%>%" height="5" border="1"></td>
</tr>
<%Else%>
<tr>
<td width="82%"><a href="default.asp?action=vote&svarID=<%=arrRecSet(3,i)%>&pollId=<%=Fraga(0)%>" class="vit"><%=arrRecSet(2,i)%></a> (<%=stat%>)</td>
<td rowspan="2" width="18%" valign="bottom" align="right"><%=Round(res,0)%>%</td>
</tr>
<tr>
<td bgcolor="<%=sidBG%>" height="5"><img src="gfx/stapel.gif" width="<%=Round(res,0)%>%" height="5" border="1"></td>
</tr>
<%End If
Next%>
<tr>
<td><br><%=strPoll_Rost%>: <%For i=1 to Len(totalt)%><%=Mid(totalt,i,1)%><%Next%></td>
<td align="right"><br><a href="old_poll.asp"><%=strPoll_Aldre%></a></td>
</tr>
<%End If
[red]End If%>[/red]
</table>
<%ElseIf Request.Querystring("action") = "vote" Then
If Int(strVotedPoll) = Int(Request.Querystring("pollId")) Then
'Conn.Close:Set Conn=Nothing
Response.Write "<script language=Javascript>"
Response.Write "self.location.href='default.asp';"
Response.Write "</script>"
Else
'Conn.Close:Set Conn=Nothing
Response.Redirect "default.asp?action=saveVote&svarID=" & Request.QueryString("svarID") & "&pollId=" & Request.Querystring("pollId")
End If
ELseIf Request.Querystring("action") = "saveVote" Then
Conn.Execute("Update com_svar Set klick=klick+1 Where id=" & FixaTecken(Request.QueryString("svarID")))
Conn.Execute("Update com_users Set votedPoll=" & FixaTecken(Request.Querystring("pollId")) & " Where userid=" & FixaTecken(Session("user_id")))
'Conn.Close:Set Conn=Nothing
Response.Write "<script language=Javascript>"
Response.Write "self.location.href='default.asp';"
Response.Write "</script>"
End If%>