Ver Mensaje Individual
  #5 (permalink)  
Antiguo 02/04/2009, 07:06
Avatar de TonyChile
TonyChile
 
Fecha de Ingreso: marzo-2009
Ubicación: Maipú, Santiago
Mensajes: 422
Antigüedad: 16 años, 1 mes
Puntos: 7
Respuesta: Problema al insertar en una tabla

OK te mando la pagina entera tal como la tengo
a lo q haces referencia es num_serie3_1 = request("Talcosa")

talcosa = al texto q se ingresa en la primera text box (numero de serie)

Código asp:
Ver original
  1. <%(arroba)LANGUAGE="VBSCRIPT"%>
  2. <script language="vbscript" runat="server">
  3.  
  4.  dim obj_conn3_1, sql3_1, num_serie3_1, equipo3_1, modelo3_1, mac3_1, pin3_1, accesorios3_1, fecha_entrega_celular3_1, fecha_retiro_celular3_1, asignado3_1, no_asignado3_1, notas3_1
  5.  
  6. </script>
  7. <head>
  8. <style type="text/css">
  9.     H1 {border-width: 1; border: solid; text-align:center}
  10. </style>   
  11. <title>EMPRESA S.A.</title>
  12. <style type="text/css">
  13. <!--
  14. body,td,th {
  15.     font-size: 12px;
  16.     color: #000000;
  17. }
  18. body {
  19.     background-color: #FFFFFF;
  20.     background-image: url();
  21.     background-repeat: no-repeat;
  22.     background-position:center;
  23. }
  24. .Estilo2 {font-size: 14px}
  25. .Estilo3 {
  26.     font-size: 18px
  27. }
  28. .Estilo5 {font-size: 18px; font-weight: bold; }
  29. .Estilo4 {
  30.     font-size: 14;
  31.     font-weight: bold;
  32. }
  33. -->
  34. </style>
  35. </head>
  36. <body>
  37.  
  38. <div align="center">
  39.   <p><img src="forosdelweb.com/images/empresa.JPG" width="262" height="76"> </p>
  40.    <p class="Estilo3">Informaci&oacute;n  Tr&aacute;fico De Celulares</p>
  41.   <p class="Estilo3">Empresa S.A.</p>
  42.   <p class="Estilo4">Ingreso de un Nuevo Celular</p>
  43. </div>
  44. <p>&nbsp;</p>
  45. <p>&nbsp;</p>
  46. <%
  47. if num_serie3_1 = "" then
  48. %>
  49.  
  50. <form method="Post" action="agregacelular.asp">
  51.  
  52. <table width="308" border="2" align="center" cellpadding="1" cellspacing="0" name="tabla">
  53.   <tr><td colspan=2 align="center" class="Estilo5">Agregar Nuevo CELULAR</td>
  54.   </tr>
  55.   <tr><td colspan="2" height=5></td></tr>
  56.      
  57.    <tr>
  58.       <td width="38%" nowrap class="Estilo4">N&uacute;mero de Serie:</td>
  59.       <td colspan="2">
  60.             <input name ="text1"  size="25" maxlength="15"><BR>
  61.       </td>
  62.    </tr>
  63.    
  64.    <tr>
  65.       <td width="38%" nowrap class="Estilo4">Equipo:</td>
  66.       <td colspan="2">
  67.             <input name="text2" size="25" maxlength="20"><BR>
  68.       </td>
  69.    </tr>
  70.    
  71.    <tr>
  72.       <td width="38%" nowrap class="Estilo4">Modelo:</td>
  73.       <td colspan="2">
  74.             <input name="text3" size="25" maxlength="10"><BR>
  75.       </td>            
  76.    </tr>
  77.    
  78.    <tr>
  79.       <td width="38%" nowrap class="Estilo4">Mac:</td>
  80.       <td colspan="2">
  81.             <input name="tetx4" size="25" maxlength="17"><BR>
  82.       </td>
  83.    </tr>
  84.    
  85.    <tr>
  86.       <td width="38%" nowrap class="Estilo4">Pin:</td>
  87.       <td colspan="2">
  88.             <input name="text5" size="25" maxlength="8"><BR>
  89.       </td>
  90.    </tr>
  91.            
  92.    <tr>
  93.       <td width="38%"  nowrap class="Estilo4">Accesorios</td>
  94.       <td colspan="2">
  95.             <input name="text6" size="25" maxlength="200"><BR>
  96.       </td>
  97.    </tr>
  98.                      
  99.    <tr>
  100.       <td width="38%" nowrap class="Estilo4">Fecha Entrega Celular</td>
  101.       <td colspan="2">
  102.             <input name="text7" size="25" maxlength="10"><BR>
  103.       </td>
  104.    </tr>
  105.            
  106.    <tr>
  107.       <td width="38%" nowrap class="Estilo4">Fecha Retiro Celular</td>
  108.       <td colspan="2">
  109.             <input name="text8" size="25" maxlength="10"><BR>
  110.       </td>
  111.    </tr>
  112.            
  113.    <tr>
  114.       <td width="38%" nowrap class="Estilo4">Asignado</td>
  115.       <td colspan="2">
  116.             <input name="text9" size="25" maxlength="50"><BR>
  117.       </td>
  118.    </tr>
  119.    
  120.    <tr>
  121.       <td width="38%" nowrap class="Estilo4">No Asignado</td>
  122.       <td colspan="2">
  123.             <input name="text10" size="25" maxlength="50"><BR>
  124.       </td>
  125.    </tr>
  126.                                            
  127.    <tr>
  128.       <td width="38%" nowrap class="Estilo4">Notas</td>
  129.       <td colspan="2">
  130.             <input name="text11" size="25" maxlength="200"><BR>
  131.       </td>
  132.    </tr>
  133.                
  134.   <tr>
  135.       <td colspan="6" align="center">
  136.           <input type="Submit" value="&nbsp;&nbsp;Agregar&nbsp;&nbsp;" onClick="return window.confirm('Desea Ingresar el registro')">
  137.       </td>
  138.       <td width="13%"></td>
  139.   </tr>    
  140. </table>
  141. <%
  142.   num_serie3_1 = request.Form("text1")
  143.   equipo3_1 = request.Form("text2")
  144.   modelo3_1 = request.Form("text3")
  145.   mac3_1 = request.Form("text4")
  146.   pin3_1 = request.Form("text5")
  147.   accesorios3_1 = request.Form("text6")
  148.   fecha_entrega_celular3_1 = request.Form("text7")
  149.   fecha_retiro_celular3_1 = request.Form("text8")
  150.   asignado3_1 = request.Form("text9")
  151.   no_asignado3_1 = request.Form("text10")
  152.   notas3_1 = request.Form("text11")
  153.  
  154.   SQL3_1 = "INSERT INTO CELULAR (NUM_SERIE, EQUIPO, MODELO, MAC, PIN, ACCESORIOS, FECHA_ENTREGA_CELULAR, FECHA_RETIRO_CELULAR, ASIGNADO, NO_ASIGNADO, NOTAS) VALUES " &  "('" & num_serie3_1 & "', '" & equipo3_1 & "', '" & modelo3_1 & "', '" & mac3_1 & "', '" & pin3_1 & "', '" & accesorios3_1 & "', '" & fecha_entrega_celular3_1 & "', '" & fecha_retiro_celular3_1 & "', '" & asignado3_1 & "', '" & no_asignado & "', '" & notas3_1 & "')"
  155.  
  156.   set obj_conn3_1=server.createobject("ADODB.connection")
  157.       obj_conn3_1.open "PRUEBA"
  158.       obj_conn3_1.execute sql3_1
  159.       obj_conn3_1.Close
  160.       set obj_conn3_1 = Nothing
  161. %>
  162. </form>
  163. <%
  164. End if
  165. %>
  166.  
  167. <p align="center">&nbsp;</p>
  168. <td width="50%" height="1" align="left"><form method="POST" name="Volver" action="principal.asp">
  169.     <p align="center">
  170.       <input type="submit" value="  P&aacute;gina Principal " name="   volver   ">
  171.     </p>
  172.   </form></td>
  173.   <td width="50%" height="1" align="left"><form method="POST" name="paginachip" action="celular.asp">
  174.      <p align="center">
  175.       <input type="submit" value=" &nbsp;&nbsp;P&aacute;gina Celular&nbsp;&nbsp; " name="   paginachip   ">
  176.     </p>
  177.  </form></td>
  178.  
  179. <p align="center">&nbsp;</p>
  180. <p align="center" class="Estilo2">Volver a p&aacute;gina Inicio EMPRESA</p>
  181. <p align="center"><a href="paginaempresa.cl/default.aspx" target="_self" class="Estilo2">paginaempresa.cl</a></p>
  182. <p align="center">&nbsp;</p>
  183.  
  184. </body>
  185. </html>


Gracias por ayudarme que estes bien