Me tira este error
Microsoft JET Database Engine error '80040e07'
No coinciden los tipos de datos en la expresión de criterios.
/pruebas/add_valoracion.asp, line 14
Código:
<%
stroconn = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("pcmstore.mdb")
set oConn = server.createobject("adodb.connection")
oConn.open stroconn
'Recupero el valor del voto y el valor del ID del producto
prodID = Request.Querystring("prodID")
votos = Request.Querystring("Votos")
'Traigo los votos actuales que tiene el producto para sumarle los nuevos
SQL="SELECT * FROM pcm_productos WHERE id_prod = '"&prodID&"' "
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.Open SQL, oConn,3,1
vact = Cint(Rs("total_votos"))
total = vact + Votos
'Sumamos uno a las votaciones
rating = Cint(Rs("votos"))+1
'Ahora que tengo el total que es lo que recibi de la base mas los votos nuevos actualizo la valoracion del producto segun su ID
SQL = "UPDATE pcm_productos Set total_votos = '"&total&"', votos = '"&rating&"' WHERE id_prod = '"&prodID&"' "
Set RS = oConn.Execute(SQL)
'Creamos una cookie con el id del producto para que no voten mas de una vez(puro grupo) le damos una semana
Response.Cookies("valoracion")("prodID")= prodID
Response.Cookies("valoracion").Expires = Now() + 7
%>
<br>
<br>
<br>
<br>
<table width="215" height="22" border="0" align="center" cellpadding="1" cellspacing="0" bgcolor="#000000">
<tr>
<td><table width="100%" height="140" border="0" cellpadding="4" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td class="text"><div align="center"><img src="http://www.pcmod.cl/images/index01.jpg" width="200" height="60"><br>
Gracias por tu Voto<br>
<a href="javascript:onClick=window.close()"><br>
Cerrar Ventana </a><br>
</div></td>
</tr>
</table></td>
</tr>
</table>
lo demas funciona todo bien hice algunos arreglos como
Código:
<html>
<head>
<title>Productos</title>
</head>
<SCRIPT>
<!--
function openWin(url, width, height)
{
var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=no,scrollbars=no,menubar=no,status=no' );
}
//-->
</SCRIPT>
<body>
<%
Set Conn = Server.CreateObject("ADODB.Connection")
strConn = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("pcmstore.mdb")
Conn.Open strConn
SQL="SELECT * FROM pcm_productos ORDER BY id_prod"
set RS = Conn.Execute(SQL)
Do While Not RS.EOF
%>
<table border="0" width="100%">
<tr>
<td width="15%">Producto</td>
<td width="85%"><% = RS("producto") %></td>
</tr>
<tr>
<td width="15%">Descripción</td>
<td width="85%"><% = RS("descripcion") %></td>
</tr>
<tr>
<td width="15%">Valoración</td>
<td width="85%">Clicks: <% = RS("clicks") %> <%
rate = Cint(Rs("total_votos"))/Cint(Rs("votos"))
rate = Round(rate)
Response.Write ("Este producto ha recibido "&Rs("votos")&" votos ")
Response.Write ("<img src="""&rate&"_star_rating.gif"" width=""66"" height=""14"" alt="""&rate&" Estrellas"" border=""0"" align=""absmiddle"">")
Response.Write (" - ")
Response.Write ("<a href=""javascript:openWin('valoracion_producto.asp?prodID=" & rs("id_prod") & "','rate_site')"" style=""font-size:""11px""; font-style: italic;"">votar</>")
%></td>
</tr>
</table><br><br>
<%
RS.MoveNext
Loop
%>
</body>
</html>