| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi all, this is the error msg.
Code:
<LI>Error Type: ADODB.Recordset (0x800A0BB9) Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. /CDV/admin/ordenes.asp, line 187 <LI>Browser Type: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322) <LI>Page: POST 20 bytes to /CDV/admin/ordenes.asp <LI>POST Data: c1=1&idOrden1=11&x=1 And the ASP code that gives me the error is this one Code:
Set rs1 = Server.CreateObject("ADODB.RecordSet")
valorFinal = CINT(Request.Form("x"))
For y = 1 to valorFinal
valorCompra = CBool(Request.Form("c" & y))
valorID = CInt(Request.Form("idOrden" & y))
rs1.open "update Ordenes set efectuoCompra=" & valorCompra & " where id="& valorID & "",conn
Next
|
|
#2
|
||||
|
||||
|
You don't need a recordset object when running Insert, Update and Delete commands.
Just use the connection object like this Code:
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Your ConnectionString"
valorFinal = CInt(Request.Form("x"))
For y = 1 to valorFinal
valorCompra = CBool(Request.Form("c") & y)
valorID = CInt(Request.Form("idOrden") & y)
Conn.Execute("UPDATE Ordenes Set efectuoCompra = " & valorCompra & " WHERE id = " & valorID)
Next
This is assuming valorCompra is an integer data type in the database. |
|
#3
|
|||
|
|||
|
I did it ur way and this is the new error
Code:
Technical Information (for support personnel)
|
|
#4
|
||||
|
||||
|
post your exact code.
|
|
#5
|
|||
|
|||
|
Ok here is the code of the whole ASP page:
Code:
<body>
<form name="formulario" action="ordenes.asp?paso=2" method="post">
<table align="center">
<tr>
<td>Fecha:</td><td><input name="fecha" type="text" value="" maxlength="10" size="10" onClick="javascript:pedirFecha(fecha,'Calendario');"></td><td><input name="b1" type="button" value="Calendario" onClick="javascript:pedirFecha(fecha,'Calendario');">
<input name="submit" type="submit" id="submit" value="Solicitar">
</td>
</tr>
</table>
</form>
<% if Request.QueryString("paso") = 2 then %>
<!--#include file="bdconn.asp"-->
<% Set rs1 = Server.CreateObject("ADODB.RecordSet")
rs1.open "select * from Ordenes where fecha ="& "#" & CDate(Request.Form("fecha")) & "#" & "order by id",conn,3,3 %>
<form name="formulario" action="ordenes.asp?accion=update" method="post">
<table align="center" cellspacing="2">
<tr>
<td align="center" bgcolor="#FF6600"><span style="font-weight: bold">Id orden:</span></td>
<td width="5"></td>
<td align="center" bgcolor="#FF6600"><span style="font-weight: bold">Cedula:</span></td>
<td width="5"></td>
<td align="center" bgcolor="#FF6600"><span style="font-weight: bold">Hora:</span></td>
<td width="5"></td>
<td align="center" bgcolor="#FF6600"><span style="font-weight: bold">Monto:</span></td>
<td width="5"></td>
<td align="center" bgcolor="#FF6600"><span style="font-weight: bold">Efectuo compra:</span></td>
</tr>
<% x = 0
while not rs1.eof
x = x + 1 %>
<tr>
<td><div align="center"><%=rs1("id")%></div></td>
<td width="5"></td>
<td><%=rs1("cedulaUsuario")%></td>
<td width="5"></td>
<td><%=rs1("hora")%></td>
<td width="5"></td>
<td><%=rs1("montoTotal")%></td>
<td width="5"></td>
<td align="center">
<% if rs1("efectuoCompra") = true then %>
<input type="radio" name="c<%=x%>" value="0">No<input type="radio" name="c<%=x%>" value="1" checked>Si
<input type="hidden" name="idOrden<%=x%>" value="<%=rs1("id")%>">
<% else %>
<input type="radio" name="c<%=x%>" value="0" checked>No<input type="radio" name="c<%=x%>" value="1">Si
<input type="hidden" name="idOrden<%=x%>" value="<%=rs1("id")%>">
<% end if %>
</td>
</tr>
<% rs1.movenext
wend %>
</table>
<% end if %>
<center><input type="submit" value="Enviar"> <input name="Reset" type="reset" value="Borrar"></center>
<input type="hidden" value="<%=x%>" name="x">
</form>
<% if Request.QueryString("accion") = "update" then
valorFinal = CINT(Request.Form("x"))
For y = 1 to valorFinal
valorCompra = Request.Form("c" & y)
valorID = Request.Form("idOrden" & y)
conn.Execute("UPDATE Ordenes Set efectuoCompra = " & valorCompra & " WHERE id = " & valorID)
Next
Response.Redirect("ordenes.asp?accion=gracias")
end if %>
<% if Request.QueryString("accion") = "gracias" then %>
<center>Se edito con exito.</center>
<% end if%>
</body>
About the database fields, the first one is a boolean (valorCompra) and the other is an integer (valorID) Thanks |
|
#6
|
||||
|
||||
|
Where is your connection object created and set?
|
|
#7
|
|||
|
|||
|
right here
Code:
<!--#include file="bdconn.asp"--> if u want the whole thing then here it is Code:
<%
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "provider=microsoft.jet.oledb.4.0;data source=" & server.MapPath("db/dbCDV.mdb")
%>
|
|
#8
|
||||
|
||||
|
which line is causing the error?
|
|
#9
|
|||
|
|||
|
is the SQL line (the one with conn.execute)
|
![]() |
| Viewing: ASP Free Forums > Programming > Code Bank > ADO ERROR! pls help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|