Hjælp til script der ikke virker !
Hej Eksperter...:Jeg for denne fejl ved mit script:
-----------------------------------------------------
Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
default.asp, line 61
-----------------------------------------------------
og linie 61 er denne:
If Valg1 <> "" then
Sql = "Select count(*) as poster_find from poll_result where voteid="& ID &" AND vote="& Valg1
-------------->Set Record = RsVote.Execute(Sql)
Procent = 100/Ialt * Record("poster_find")
%>
-----------------------------------------------------
Jeg har dette script...:
-----------------------------------------------------
<%
SQL = "SELECT * FROM instil where ID='farve'"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open SQL, Conn,1, 2
%><table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td class="menu_over" style="background-color:#<%=rs("1")%>;">afstemning</td>
</tr>
</table>
<%
Set RsVote = Server.CreateObject("ADODB.Connection")
DBPath = "DBQ=" & server.mappath("going.mdb")
RsVote.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & DBPath
Sql = "select * from poll_navn ORDER BY dato DESC"
Set Record = RsVote.Execute(Sql)
id = Record("id")
Valg1 = Record("Valg1")
Valg2 = Record("Valg2")
Valg3 = Record("Valg3")
Valg4 = Record("Valg4")
Valg5 = Record("Valg5")
If Not Record.EOF then
If (Len(Request.Cookies("stem")(CSTR(id)))) then
%><%
SQL = "SELECT * FROM instil where ID='farve'"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open SQL, Conn,1, 2
%><div style="background-color:#<%=rs("2")%>;">
<img src="img/pix.gif" border="0" height="4" width="1"><br>
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td class="menu" align="center">
<%
secTxt = Record("Beskrivelse")
secTxt = replace(secTxt,vbCrLf,"<br>")
secTxt = replace(secTxt,"<b>","<b>")
secTxt = replace(secTxt,"</b>","</b>")
secTxt = replace(secTxt,"<i>","<i>")
secTxt = replace(secTxt,"</i>","</i>")
secTxt = replace(secTxt,"<u>","<u>")
secTxt = replace(secTxt,"</u>","</u>")
response.write makeLinks(secTxt)
%>
</td>
</tr>
</table>
<%
Sql = "Select count(*) as Found from poll_result where voteid="& ID
Set Record = RsVote.Execute(Sql)
Ialt = Record("found")
If Valg1 <> "" then
Sql = "Select count(*) as poster_find from poll_result where voteid="& ID &" AND vote="& Valg1
Set Record = RsVote.Execute(Sql)
Procent = 100/Ialt * Record("poster_find")
%>
<div style="position:relative;top:0px;left:0px;"><div style="position:absolute;top:16px;left:0px;z-index:-1;width:100%;background-image:URL(img/8.gif);"><% if Round(procent) <> "0" then %><img src="img/14.gif" border="0" height="10" width="<% response.write Round(procent) %>%" style="filter:alpha(opacity=66);"><br><% else %><img src="img/pix.gif" border="0" height="10" width="<% response.write Round(procent) %>%"><% end if %></div>
<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td style="color:#000000;font-family:Verdana;font-size:11px;padding-left:8px;font-weight:bold;">
<% Record("Valg1") %></td></tr><tr><td align="center" style="color:#000000;font-family:Verdana;font-size:10px;padding-top:1px;padding-bottom:1px;">(<% Round(procent) %>%)</td></tr></table>
</div>
<%end if
If Record("Valg2") <> "" then%>
<div style="position:relative;top:0px;left:0px;"><div style="position:absolute;top:16px;left:0px;z-index:-1;width:100%;background-image:URL(img/8.gif);"><% if Round(procent) <> "0" then %><img src="img/14.gif" border="0" height="10" width="<% response.write Round(procent) %>%" style="filter:alpha(opacity=66);"><br><% else %><img src="img/pix.gif" border="0" height="10" width="<% response.write Round(procent) %>%"><% end if %></div>
<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td style="color:#000000;font-family:Verdana;font-size:11px;padding-left:8px;font-weight:bold;">
<% Record("Valg2") %></td></tr><tr><td align="center" style="color:#000000;font-family:Verdana;font-size:10px;padding-top:1px;padding-bottom:1px;">(<% Round(procent) %>%)</td></tr></table>
</div>
<%end if
If Record("Valg3") <> "" then%>
<div style="position:relative;top:0px;left:0px;"><div style="position:absolute;top:16px;left:0px;z-index:-1;width:100%;background-image:URL(img/8.gif);"><% if Round(procent) <> "0" then %><img src="img/14.gif" border="0" height="10" width="<% response.write Round(procent) %>%" style="filter:alpha(opacity=66);"><br><% else %><img src="img/pix.gif" border="0" height="10" width="<% response.write Round(procent) %>%"><% end if %></div>
<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td style="color:#000000;font-family:Verdana;font-size:11px;padding-left:8px;font-weight:bold;">
<% Record("Valg3") %></td></tr><tr><td align="center" style="color:#000000;font-family:Verdana;font-size:10px;padding-top:1px;padding-bottom:1px;">(<% Round(procent) %>%)</td></tr></table>
</div>
<%end if
If Record("Valg4") <> "" then%>
<div style="position:relative;top:0px;left:0px;"><div style="position:absolute;top:16px;left:0px;z-index:-1;width:100%;background-image:URL(img/8.gif);"><% if Round(procent) <> "0" then %><img src="img/14.gif" border="0" height="10" width="<% response.write Round(procent) %>%" style="filter:alpha(opacity=66);"><br><% else %><img src="img/pix.gif" border="0" height="10" width="<% response.write Round(procent) %>%"><% end if %></div>
<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td style="color:#000000;font-family:Verdana;font-size:11px;padding-left:8px;font-weight:bold;">
<% Record("Valg4") %></td></tr><tr><td align="center" style="color:#000000;font-family:Verdana;font-size:10px;padding-top:1px;padding-bottom:1px;">(<% Round(procent) %>%)</td></tr></table>
</div>
<%end if
If Record("Valg5") <> "" then%>
<div style="position:relative;top:0px;left:0px;"><div style="position:absolute;top:16px;left:0px;z-index:-1;width:100%;background-image:URL(img/8.gif);"><% if Round(procent) <> "0" then %><img src="img/14.gif" border="0" height="10" width="<% response.write Round(procent) %>%" style="filter:alpha(opacity=66);"><br><% else %><img src="img/pix.gif" border="0" height="10" width="<% response.write Round(procent) %>%"><% end if %></div>
<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td style="color:#000000;font-family:Verdana;font-size:11px;padding-left:8px;font-weight:bold;">
<% Record("Valg5") %></td></tr><tr><td align="center" style="color:#000000;font-family:Verdana;font-size:10px;padding-top:1px;padding-bottom:1px;">(<% Round(procent) %>%)</td></tr></table>
</div>
<%end if
else
session("retur") = Request.ServerVariables("SCRIPT_NAME")
%>
<div style="background-color:#A3CBC8;">
<img src="img/pix.gif" border="0" height="4" width="1"><br>
<%
secTxt = Record("Beskrivelse")
secTxt = replace(secTxt,vbCrLf,"<br>")
secTxt = replace(secTxt,"<b>","<b>")
secTxt = replace(secTxt,"</b>","</b>")
secTxt = replace(secTxt,"<i>","<i>")
secTxt = replace(secTxt,"</i>","</i>")
secTxt = replace(secTxt,"<u>","<u>")
secTxt = replace(secTxt,"</u>","</u>")
response.write "<form method='POST' action='?cmd=stem' style='margin:0px;'><input type='hidden' name='Voteid' value=" & Id & ">"
response.write "<table cellspacing='0' cellpadding='0' border='0' width='100%'><tr><td class='menu' align='center'>" & makeLinks(secTxt) & "</td></tr></table>"
If Record("Valg1") <> "" then
response.write "<table cellspacing='0' cellpadding='0' border='0' width='100%'><tr>"
response.write "<td valign='top' width='20' style='color:#000000;font-family:Verdana;font-size:11px;padding-left:5px;font-weight:bold;'><input type='radio' value='" & Record("Valg1") & "' name='r1'></td>"
response.write "<td style='color:#000000;font-family:Verdana;font-size:11px;padding-left:6px;'>" & Record("Valg1") & "</td>"
response.write "</tr></table>"
end if
If Record("Valg2") <> "" then
response.write "<table cellspacing='0' cellpadding='0' border='0' width='100%'><tr>"
response.write "<td valign='top' width='20' style='color:#000000;font-family:Verdana;font-size:11px;padding-left:5px;font-weight:bold;'><input type='radio' value='" & Record("Valg2") & "' name='r1'></td>"
response.write "<td style='color:#000000;font-family:Verdana;font-size:11px;padding-left:6px;'>" & Record("Valg2") & "</td>"
response.write "</tr></table>"
end if
If Record("Valg3") <> "" then
response.write "<table cellspacing='0' cellpadding='0' border='0' width='100%'><tr>"
response.write "<td valign='top' width='20' style='color:#000000;font-family:Verdana;font-size:11px;padding-left:5px;font-weight:bold;'><input type='radio' value='" & Record("Valg3") & "' name='r1'></td>"
response.write "<td style='color:#000000;font-family:Verdana;font-size:11px;padding-left:6px;'>" & Record("Valg3") & "</td>"
response.write "</tr></table>"
end if
If Record("Valg4") <> "" then
response.write "<table cellspacing='0' cellpadding='0' border='0' width='100%'><tr>"
response.write "<td valign='top' width='20' style='color:#000000;font-family:Verdana;font-size:11px;padding-left:5px;font-weight:bold;'><input type='radio' value='" & Record("Valg4") & "' name='r1'></td>"
response.write "<td style='color:#000000;font-family:Verdana;font-size:11px;padding-left:6px;'>" & Record("Valg4") & "</td>"
response.write "</tr></table>"
end if
If Record("Valg5") <> "" then
response.write "<table cellspacing='0' cellpadding='0' border='0' width='100%'><tr>"
response.write "<td valign='top' width='20' style='color:#000000;font-family:Verdana;font-size:11px;padding-left:5px;font-weight:bold;'><input type='radio' value='" & Record("Valg5") & "' name='r1'></td>"
response.write "<td style='color:#000000;font-family:Verdana;font-size:11px;padding-left:6px;'>" & Record("Valg5") & "</td>"
response.write "</tr></table>"
end if
response.write "<table cellspacing='0' cellpadding='0' border='0' width='100%'><tr><td style='padding-left:30px;padding-right:30px;'><input type='submit' value='stem' style='background-color:#FFFFFF;width:100%;height:18px;padding-top:1px;text-align:center;border:1px solid #000000;color:#000000;font-family:Verdana;font-size:10px;'></td></tr></table></form>"
end if
end if
%><img src="img/pix.gif" border="0" height="4" width="1"><br>
<img src="img/1.gif" border="0" height="2" width="100%"><br>
</div>
<img src="img/pix.gif" border="0" height="20" width="1"><br>
