![]() |
Ayuda con Request.querystring Necesito ayuda con lo q estoy haciendo, tengo una lista de alumnos con botones al lado, al dar click en el boton envio el id del alumno a un formulario q lo recibe con un request.querystring <% if request.form="" then 'no recibo formulario, entonces lo muestro 'solicitamos la variable q pasamos por url Request.QueryString("id") codigos=Request.QueryString("id") %> lo q yo quiero es q al guardar los datos en la base de datos una vez q haya echo el insert vuelva a regresar otra ve al formulario y no tener q hacer todo el proceso de nuevo, osea seguir calificando a ese mismo alumno. Para hacer eso hago esto despues de haber echo el insert Response.Redirect("n_subcomponente.asp?id="&codigo s&"") se supone q me redireccionara a la pagina y llevara ese codigo q es el id del alumno, pero al darle click a guardar me sale el siguiente error: Tipo de error: ADODB.Field (0x800A0BCD) El valor de BOF o EOF es True, o el actual registro se eliminó; la operación solicitada requiere un registro actual. /fida/programa/n_subcomponente.asp, línea 248 necesito su ayuda por favor |
Re: Ayuda con Request.querystring :adios: creo que este tema seria mas factible para ti, en AJAX, ya que si calificas alumno por alumno, entonces mediante AJAX, haces el guardado rapido, sin salir del formulario de listado :pensando: no se que opines al respecto?? ademas ya tienes todo listo, solo seria acondicionar para que funcione AJAX |
Re: Ayuda con Request.querystring Lo conveniente seria que muestres cual es la línea 248 de n_subcomponente.asp que es donde te tira el error, y unas lineas anteriores y posteriores para referencia. Si por casualidad la linea 248 es donde haces el INSERT, yo creo que tu problema es debido a que estas tratando de guardar los datos en la base de datos de una forma erronea. Si el id es numerico, antes ponle un cInt(variable), y cuando hagas la consulta ponlo entre apostrofes 'variable' Saludos! :adios: |
Re: Ayuda con Request.querystring Esta es la linea 248 <input name="codigo" type="text" id="codigo" style="width:60px" value="<%=(Recordset2.Fields.Item("codigo").Value) %>."/> no se por q me bota este tipo de error por q a pesar de eso me llega a realizar el insert es un error con el Request.querystring por q si cambio y pongo por ejemplo asi: Response.Redirect("n_resultado.asp?id=" & 1 & "") no me bota ningun tipo de error, pero si pongo asi: Response.Redirect("n_resultado.asp?id=" & codigo & "") donde codigo seria la variable q estoy tomando con el request.query string echa el principio de la pagina: Request.QueryString("id") codigo=Request.QueryString("id") no se si me entenderan lo q supuestamente debe hacer es el dato enviarmelo denuvo,asi por ejemplo si tomo un alumno con el ID = 1 al guardar lo q quedria decir seria Response.Redirect("n_resultado.asp?id=1) donde 1 seria el valor q contiene codigo. Con respecto a realizarlo en ajax se q seria buena idea pero lo ideal es lograrlo en asp, pues se q tambien se puede realizar desde aqui, espero su ayuda, muchas gracias :policia: |
Re: Ayuda con Request.querystring MMmmm asi que el error te lo tira aca: <%=(Recordset2.Fields.Item("codigo").Value) %> Supongo que cuando abres el RecordSet, en el SQL tu le pones algo asi como WHERE codigo = Request.QueryString("id") Y ese es el id que estabas pasando del formulario... creo que por ahi esta dando vueltas el error... revisa bien todas las variables, revisa lo que te puse mas arriba: Cita:
|
Re: Ayuda con Request.querystring Pues no logro solucionar mi problema :neurotico Pasare el codigo para ver si ustedes pueden ayudarme ************************************************** ************** ************************************************** ************** <%@LANGUAGE="VBSCRIPT"%> <!--#include file="Connections/BD_Colombia.asp" --> <% 'Página privada if Session("ID")=0 then Response.Redirect("index.asp") Response.End end if %> <% if request.form="" then 'no recibo formulario, entonces lo muestro 'solicitamos la variable q pasamos por url Request.QueryString("id") id=Request.QueryString("id") %> <% Dim Recordset1__MMColParam Recordset1__MMColParam = "idcomponente" If (Request("MM_EmptyValue") <> "") Then Recordset1__MMColParam = Request("MM_EmptyValue") End If %> <% Dim Recordset1 Dim Recordset1_numRows Set Recordset1 = Server.CreateObject("ADODB.Recordset") Recordset1.ActiveConnection = MM_BD_Colombia_STRING Recordset1.Source = "SELECT idsubcomponente,codigo, subcomponente,idcomponente FROM PFsubcomponente WHERE idcomponente = '" & id& "';" Recordset1.CursorType = 0 Recordset1.CursorLocation = 2 Recordset1.LockType = 1 Recordset1.Open() Recordset1_numRows = 0 %> <% Dim Recordset2 Dim Recordset2_numRows Set Recordset2 = Server.CreateObject("ADODB.Recordset") Recordset2.ActiveConnection = MM_BD_Colombia_STRING Recordset2.Source = "SELECT codigo FROM oscar.PFcomponente WHERE idcomponente = '" & id & "';" Recordset2.CursorType = 0 Recordset2.CursorLocation = 2 Recordset2.LockType = 1 Recordset2.Open() Recordset2_numRows = 0 %> <% Dim Repeat1__numRows Dim Repeat1__index Repeat1__numRows = -1 Repeat1__index = 0 Recordset1_numRows = Recordset1_numRows + Repeat1__numRows %> <% ' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables Dim Recordset1_total Dim Recordset1_first Dim Recordset1_last ' set the record count Recordset1_total = Recordset1.RecordCount ' set the number of rows displayed on this page If (Recordset1_numRows < 0) Then Recordset1_numRows = Recordset1_total Elseif (Recordset1_numRows = 0) Then Recordset1_numRows = 1 End If ' set the first and last displayed record Recordset1_first = 1 Recordset1_last = Recordset1_first + Recordset1_numRows - 1 ' if we have the correct record count, check the other stats If (Recordset1_total <> -1) Then If (Recordset1_first > Recordset1_total) Then Recordset1_first = Recordset1_total End If If (Recordset1_last > Recordset1_total) Then Recordset1_last = Recordset1_total End If If (Recordset1_numRows > Recordset1_total) Then Recordset1_numRows = Recordset1_total End If End If %> <% ' *** Recordset Stats: if we don't know the record count, manually count them If (Recordset1_total = -1) Then ' count the total records by iterating through the recordset Recordset1_total=0 While (Not Recordset1.EOF) Recordset1_total = Recordset1_total + 1 Recordset1.MoveNext Wend ' reset the cursor to the beginning If (Recordset1.CursorType > 0) Then Recordset1.MoveFirst Else Recordset1.Requery End If ' set the number of rows displayed on this page If (Recordset1_numRows < 0 Or Recordset1_numRows > Recordset1_total) Then Recordset1_numRows = Recordset1_total End If ' set the first and last displayed record Recordset1_first = 1 Recordset1_last = Recordset1_first + Recordset1_numRows - 1 If (Recordset1_first > Recordset1_total) Then Recordset1_first = Recordset1_total End If If (Recordset1_last > Recordset1_total) Then Recordset1_last = Recordset1_total End If End If %> ........ |
Re: Ayuda con Request.querystring <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <style type="text/css"> /*----------Text Styles----------*/ .ws6 {font-size: 8px;} .ws7 {font-size: 9.3px;} .ws8 {font-size: 11px;} .ws9 {font-size: 12px;} .ws10 {font-size: 13px;} .ws11 {font-size: 15px;} .ws12 {font-size: 16px;} .ws14 {font-size: 19px;} .ws16 {font-size: 21px;} .ws18 {font-size: 24px;} .ws20 {font-size: 27px;} .ws22 {font-size: 29px;} .ws24 {font-size: 32px;} .ws26 {font-size: 35px;} .ws28 {font-size: 37px;} .ws36 {font-size: 48px;} .ws48 {font-size: 64px;} .ws72 {font-size: 96px;} .wpmd {font-size: 13px;font-family: 'Arial';font-style: normal;font-weight: normal;} /*----------Para Styles----------*/ DIV,UL,OL /* Left */ { margin-top: 0px; margin-bottom: 0px; } </style> <style type="text/css"> a.style1:link{color:#808080;text-decoration: none;} a.style1:visited{color:#808080;text-decoration: none;} a.style1:active{color:#808080;text-decoration: none;} a.style1:hover{color:#003366;text-decoration: none;} a.style2:link{color:#FF6600;text-decoration: none;} a.style2:visited{color:#FF6600;text-decoration: none;} a.style2:active{color:#FF6600;text-decoration: none;} a.style2:hover{color:#993300;text-decoration: none;} </style> <style type="text/css"> div#container { position:relative; width: 779px; margin-top: 0px; margin-left: auto; margin-right: auto; text-align:left; } body {text-align:center;margin:0} </style> <title>.::Busquedas::.</title> <style type="text/css"> <!-- .Estilo1 {font-family: Arial, Helvetica, sans-serif} .Estilo9 {font-family: Arial, Helvetica, sans-serif; font-size: 10px; } --> </style> </head> <body background="http://www.forosdelweb.com/images/fondo-oportunidades.gif"> <table width="746" height="34" border="0" align="center" cellspacing="0"> <tr> <td width="19" background="http://www.forosdelweb.com/images/line_left.jpg" bgcolor="#FFFFFF"> </td> <td bgcolor="#FFFFFF" valign="top"><table width="100%" border="0" cellspacing="0"> <tr> <td height="34" background="http://www.forosdelweb.com/images/top_line.gif"> </td> </tr> <tr> <td height="34"><object width="706" height="159" classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"> <param name="movie" value="http://www.forosdelweb.com/images/head.swf" /> <param name="quality" value="high" /> <param name="loop" value="1" /> <param name="wmode" value="window" /> <embed src="http://www.forosdelweb.com/images/head.swf" width="706" height="159" quality="high" type="application/x-shockwave-flash" wmode="window" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed> </object></td> </tr> </table> <table width="100%" height="38" border="0" cellspacing="0"> <tr> <td background="http://www.forosdelweb.com/images/line_2.jpg"><div align="left"><font color="#008000" class="ws9 Estilo1"><b> NUEVO SUBCOMPONENTE </b></font></div></td> <td background="http://www.forosdelweb.com/images/line_2.jpg"><div align="center"><a href="p_programa.asp"><font color="#008000" class="ws9 Estilo1"><b>Inicio</b></font></a></div></td> </tr> </table> <form name="f" method="post" action="n_subcomponente.asp"> <table width="54%" border="0" align="center" cellspacing="0"> <tr> <td bgcolor="#339966"><div align="left"><font color="#FFFFFF" class="ws8 Estilo1">Componente</font></div></td> </tr> <tr> <td bgcolor="#99FFCC"> <div align="left"> <input name="idcomponente" type="text" id="idcomponente" style="width:50px;font-weight:bold;background:#99CCCC" onfocus = "this.blur()" value="<%Response.Write id%>"/> </div></td> </tr> <tr> <td bgcolor="#339966"><div align="left"><font color="#FFFFFF" class="ws8 Estilo1">Codigo Sub Componente</font></div></td> </tr> <tr> <td bgcolor="#99FFCC"> <div align="left"> <input name="codigo" type="text" id="codigo" style="width:60px" value="<%=(Recordset2.Fields.Item("codigo").Value) %>."/> </div></td> </tr> <tr> <td bgcolor="#339966"><div align="left"><font color="#FFFFFF" class="ws8 Estilo1">SubComponente</font></div></td> </tr> <tr> <td bgcolor="#99FFCC"><label> <div align="center"> <textarea name="subcomponente" id="subcomponente" style="width:350px;Height:80px"></textarea> </div> </label></td> </tr> <tr> <td bgcolor="#99FFCC"><label> <div align="center"> <input type="submit" name="Submit" value="Enviar" /> </div> </label></td> </tr> </table> </form> <p align="left" class="Estilo9"><font class="ws8"> Registros <%=(Recordset1_first)%> a <%=(Recordset1_last)%> de <%=(Recordset1_total)%></font></p> <table border="0" align="center" cellspacing="0"> <tr> <td width="99" bgcolor="#008000"><div align="center" class="Estilo9"><font class="ws8" color="#FFFFFF">Codigo</font></div></td> <td width="422" bgcolor="#008000"><div align="left"><span class="Estilo9"><font class="ws8" color="#FFFFFF">Sub Componente</font></span></div></td> <td width="55" bgcolor="#008000"><div align="center"><span class="Estilo9"><font class="ws8" color="#FFFFFF">Borrar</font></span></div></td> </tr> <% While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF)) %> <tr bgcolor="#99FFCC"> <td><div align="center"><span class="Estilo9"><font class="ws8"><%=(Recordset1.Fields.Item("codigo").V alue)%></font></span></div></td> <td bgcolor="#99FFCC"><div align="left"><span class="Estilo9"><font class="ws8"><%=(Recordset1.Fields.Item("subcompone nte").Value)%></font></span></div></td> <td valign="middle"><center> <a href="b_subcomponente.asp?id=<%Response.Write Recordset1("idsubcomponente")%>"><img src="http://www.forosdelweb.com/images/013.png" border="0"></a></center></td> </tr> <% Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1 Recordset1.MoveNext() Wend %> </table> <p> </p> <table width="100%" height="30" border="0" cellspacing="0"> <tr> <td background="http://www.forosdelweb.com/images/line_4.jpg" valign="baseline"> </td> </tr> </table> <table width="100%" height="72" border="0" cellspacing="0"> <tr> <td background="http://www.forosdelweb.com/images/bottom_line.jpg" valign="baseline"> </td> </tr> </table></td> <td width="19" background="http://www.forosdelweb.com/images/line_right.jpg" bgcolor="#FFFFFF"> </td> </tr> </table> </body> </html> <% Recordset1.Close() Set Recordset1 = Nothing %> <% Recordset2.Close() Set Recordset2 = Nothing %> <% else 'si que recibo un formulario, entonces lo trato 'recojo los datos idcomponente=Request.Form("idcomponente") codigo=Request.Form("codigo") subcomponente=Request.Form("subcomponente") 'hacemos toda la conexion a la BD. Set oConn = Server.CreateObject("ADODB.Connection") oConn.Open "Provider=SQLOLEDB;Data Source=ip;database=dataa;uid=userr;pwd=pass;" 'Hago el INSERT, creando un nuevo registro. oConn.execute "INSERT INTO PFsubcomponente VALUES('"&codigo&"','"&subcomponente&"','"&idcompo nente&"')" oConn.Close Set oConn = nothing Response.Clear Response.Redirect("n_tarea.asp?id="&id&"") end if %> Me bota un ERROR DE ESTE TIPO: Tipo de error: ADODB.Field (0x80020009) El valor de BOF o EOF es True, o el actual registro se eliminó; la operación solicitada requiere un registro actual. /fida/programa/n_tarea.asp EN EL NAVEGADOR APARECE ESTO: http://localhost/fida/programa/n_tarea.asp?id= como veran no me envia el dato :( |
Re: Ayuda con Request.querystring haber en que parte tienes que tu "ID" tome valor, que no lo miro en el codigo ehh :pensando:???? no deberia de ser en esta parte asi?? Cita:
|
Re: Ayuda con Request.querystring Pues si eso era lo que faltaba, era mas facil pero por q no pude bajar la variable q solicite por request querystring: Request.QueryString("id") id=Request.QueryString("id") De todas maneras muchas gracias por tu ayuda :si::si: |
| La zona horaria es GMT -6. Ahora son las 09:38. |
Desarrollado por vBulletin® Versión 3.8.7
Derechos de Autor ©2000 - 2026, Jelsoft Enterprises Ltd.