Er der nogen der kan hjælpe mig med den her afstemning? jeg har taget mange af tingene fra et gammelt PHP script og lavede lidt om på det hele, nu har jeg så sat det sammen, men når jeg uploader det og tester det for jeg fejlen:
Error Type:
Sun ONE ASP VBScript runtime (0x800A0006)
Overflow
forside.asp, line 43Min forside.asp fil ser sådan her ud:
<!--#include file="Connections/db.asp"-->
<% If Request.QueryString("Submit") <> "" Then %>
<%
Set indlaeg = Server.CreateObject("ADODB.Recordset")
sql = "SELECT * FROM vote"
indlaeg.Open sql, MM_db_STRING, 1, 2
indlaeg.AddNew
indlaeg("var") = Request.QueryString("var")
indlaeg.Update
Response.Cookies("VOTE")("stemt") = "ja"
Response.Cookies("VOTE").expires = Date+30
Response.Redirect("default.asp")
%>
<%
End If
%>
<%
Set rsvote = Server.CreateObject("ADODB.Recordset")
sql = "SELECT * FROM vote_form"
rsvote.Open sql, MM_db_STRING, 1, 2
%>
<% If Request.Cookies("VOTE")("stemt") <> "" Then %>
<%
Set sam = Server.CreateObject("ADODB.Recordset")
sql = "Select count(*) as antal from vote"
30 sam.Open sql, MM_db_STRING, 1, 2
31
32 Set vote1 = Server.CreateObject("ADODB.Recordset")
33 sql1 = "Select count(*) as antal from vote where var=1"
34 vote1.Open sql1, MM_db_STRING, 1, 2
35
36 Set vote2 = Server.CreateObject("ADODB.Recordset")
37 sql2 = "Select count(*) as antal from vote where var=2"
38 vote2.Open sql2, MM_db_STRING, 1, 2
39
40 Set vote3 = Server.CreateObject("ADODB.Recordset")
41 sql3 = "Select count(*) as antal from vote where var=3"
42 vote3.Open sql3, MM_db_STRING, 1, 2
43
44 Set vote4 = Server.CreateObject("ADODB.Recordset")
45 sql4 = "Select count(*) as antal from vote where var=4"
46 vote4.Open sql4, MM_db_STRING, 1, 2
47
48 res1 = (vote1("antal") / (sam("antal") / 100)) * 3
49 res2 = (vote2("antal") / (sam("antal") / 100)) * 3
50 res3 = (vote3("antal") / (sam("antal") / 100)) * 3
51 res4 = (vote4("antal") / (sam("antal") / 100)) * 3
52
53 ress1 = round((res1 / 3), 2)
54 ress2 = round((res2 / 3), 2)
55 ress3 = round((res3 / 3), 2)
56 ress4 = round((res4 / 3), 2)
57 samlet = sam("antal")
58 antal1 = vote1("antal")
59 antal2 = vote2("antal")
60 antal3 = vote3("antal")
antal4 = vote4("antal")
%>
Stemmer i alt <i><% = samlet %></i>
<table width="200">
<tr>
<td width="60">
<% = rsvote("vote1") %>
</td>
<td width="<% = res1 %>" bgcolor="#990000">
<% = ress1 %> %
</td>
</tr>
<tr>
<td>
<% = rsvote("vote2") %>
</td>
<td width="<% = res2 %>" bgcolor="#990000">
<% = ress2 %> %
</td>
</tr>
<tr>
<td>
<% = rsvote("vote3") %>
</td>
<td width="<% = res3 %>" bgcolor="#990000">
<% = ress3 %> %
</td>
</tr>
<tr>
<td>
<% = rsvote("vote4") %>
</td>
<td width="<% = res4 %>" bgcolor="#990000">
<% = ress4 %> %
</td>
</tr>
</table>
<% Else %>
<form method="get" action="forside.asp" name="vote">
<% = rsvote("overskrift") %>
<table width="200" height="150px">
<tr>
<td class="vote">
<% = rsvote("valg1") %>
</td>
<td >
<input type="radio" name="var" value="1"/>
</td>
</tr>
<tr>
<td class="vote">
<% = rsvote("valg2") %>
</td>
<td>
<input type="radio" name="var" value="2"/>
</td>
</tr>
<tr>
<td class="vote">
<% = rsvote("valg3") %>
</td>
<td>
<input type="radio" name="var" value="3"/>
</td>
</tr>
<tr>
<td class="vote">
<% = rsvote("valg4") %>
</td>
<td>
<input type="radio" name="var" value="4"/>
</td>
</tr>
<tr>
<td>
</td>
<td align="right">
<input type="submit" name="Submit" value="Stem!" />
</td>
</tr>
</table>
</form>
<% End If %>
Jeg har skrevet linje tal fra linje 30 til linje 60 hvis det da er nogen hjælp. Håber i kan hjælpe mig.
I må selvfølgelig også godt skrive hvis nogen ved hvor jeg kan downloade et afstemnings script som virker.
Indlæg senest redigeret d. 05.04.2006 18:16 af Bruger #8773