Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old August 20th, 2004, 05:58 PM
raulriera raulriera is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 5 raulriera User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation ADO ERROR! pls help

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

Reply With Quote
  #2  
Old August 20th, 2004, 07:17 PM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,760 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 5 h 22 m 16 sec
Reputation Power: 443
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.

Reply With Quote
  #3  
Old August 20th, 2004, 09:37 PM
raulriera raulriera is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 5 raulriera User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I did it ur way and this is the new error

Code:
 
Technical Information (for support personnel)
  • Error Type: Microsoft VBScript runtime (0x800A01A8) Object required: '' /CDV/admin/ordenes.asp, line 187
  • Browser Type: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)
  • Page: POST 37 bytes to /CDV/admin/ordenes.asp
  • POST Data: c1=0&idOrden1=11&c2=1&idOrden2=12&x=2
Thanks for ur current help anyway

Reply With Quote
  #4  
Old August 20th, 2004, 11:42 PM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,760 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 5 h 22 m 16 sec
Reputation Power: 443
post your exact code.

Reply With Quote
  #5  
Old August 21st, 2004, 09:06 AM
raulriera raulriera is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 5 raulriera User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #6  
Old August 21st, 2004, 06:01 PM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,760 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 5 h 22 m 16 sec
Reputation Power: 443
Where is your connection object created and set?

Reply With Quote
  #7  
Old August 21st, 2004, 06:36 PM
raulriera raulriera is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 5 raulriera User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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")
%>

Reply With Quote
  #8  
Old August 21st, 2004, 08:51 PM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,760 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 5 h 22 m 16 sec
Reputation Power: 443
which line is causing the error?

Reply With Quote
  #9  
Old August 22nd, 2004, 12:51 AM
raulriera raulriera is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 5 raulriera User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
is the SQL line (the one with conn.execute)

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > ADO ERROR! pls help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway