Ir al contenido


Foto

insertar , guardar, borrar,salir


  • Por favor identifícate para responder
No hay respuestas en este tema

#1 nefarias

nefarias

    Newbie

  • Miembros
  • Pip
  • 1 mensajes

Escrito 13 marzo 2013 - 07:31



asp
  1. <%
  2.  
  3.  
  4. %>
  5.  
  6.  
  7. <html>
  8. <style type="text/css">
  9. <!--
  10. .Estilo1 {
  11. font-size: 14px;
  12. font-weight: bold;
  13. }
  14. .Estilo4 {font-size: 14px}
  15. -->
  16. </style>
  17. <head>
  18. <title>:: Ingreso de Solicitud de Compra ::</title>
  19. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  20. <link href="estilos/estilos_n.css" rel="stylesheet" type="text/css">
  21. <script src="librerias/numeros.js"></script>
  22. </head>
  23. <body bgcolor="#FFFFEF" >
  24. <table>
  25. <td width="800">
  26.  
  27. <fieldset>
  28. <form name="Ingreso_Alumnos" method="post" enctype="multipart/form-data" action="GrabaAlumnos.asp">
  29. <table width="100%" border="0" cellpadding="0" cellspacing="0">
  30. <tr bgcolor="#CCCCCC"><td colspan="3"><span class="Estilo1"><b>Ingreso de Alumnos</b></td></tr>
  31. <tr><td colspan="3">&nbsp;</td></tr><!-- -- -->
  32.   <tr>
  33.       <td  class="destaca"><strong>ID</strong>:</td>
  34.       <td width="25"  class="destaca">:</td>
  35. <td ><input name="id" type="Text" id="nombre" size="30" maxlength="10" class="destaca"></td>
  36.     </tr><!-- -- -->
  37.       <tr>
  38.       <td  class="destaca"><strong>DES</strong>:</td>
  39.       <td width="25"  class="destaca">:</td>
  40. <td ><input name="des" type="Text" id="nombre" size="30" maxlength="10" class="destaca"></td>
  41.     </tr><!-- -- -->
  42.     <tr>
  43.       <td  class="destaca"><strong>FECHA</strong>:</td>
  44.       <td width="25"  class="destaca">:</td>
  45. <td ><input name="fecha" type="Text" id="nombre" size="30" maxlength="10" class="destaca"></td>
  46.     </tr><!-- -- -->
  47.  
  48.  
  49.   <tr><td colspan="3" align="center">&nbsp;</td></tr>
  50.   <tr><td colspan="3" align="center"><input type="submit" name="grabar" value="Grabar" class="destaca"></td></tr>
  51. </table>
  52. </form>
  53. </fieldset>
  54.  
  55.  
  56. </body>
  57. </html>



FORMULARIO : IngresoAlumnos.asp
---------------------------------------------------------------------------------------------------------------------------------


asp
  1. <!-- #INCLUDE FILE="librerias/funciones.inc" -->
  2. <!-- #INCLUDE FILE="librerias/dsn.inc" -->
  3.  
  4. <%
  5. Dim id,des,fecha
  6.  
  7. id = Request.Form("id")
  8. des = Request.Form("des")
  9. fecha = Request.Form("fecha")
  10. 'Creamos la conexion a la BD.
  11. Dim cn
  12. Set cn = Server.CreateObject("ADODB.Connection")
  13. 'set dbconnection = server.createobject("ADODB.connection")
  14. cn.open SESSION("DSN_Ejemplo")
  15. dim strSQL
  16.  
  17. strSQL = "INSERT INTO Ejemplo(id,des,fecha) "
  18. strSQL = strSQL & " VALUES('" & id & "','" & des & "','" & fecha & "')"
  19. on error resume next
  20.  
  21. if cn.Errors.Count > 0 then
  22.   ErrMsg = replace( cn.Errors(0).Description, "[Microsoft][ODBC SQL Server Driver][SQL Server]", " " )
  23.         rs1.close
  24.         cn.close
  25.   set rs1 = Nothing
  26.   set cn = Nothing
  27.   'xx = vererror(ErrMsg,"Ha ocurrido un Error" )       
  28.   response.write(ErrMsg)
  29.         response.end
  30. end if
  31. 'Dim Usuario, Clave, Nombre, Domicilio, CP, Telefono, Mail
  32.  
  33. 'Usuario = Request.Form("Usuario")
  34. 'Clave = Request.Form("Clave")
  35. 'Nombre = Request.Form("Nombre")
  36. 'Domicilio = Request.Form("Domicilio")
  37. 'CP = Request.Form("CP")
  38. 'Telefono = Request.Form("Telefono")
  39. 'Mail = Request.Form("Mail")
  40.  
  41. 'Dim cn
  42. 'Set cn = Server.CreateObject("ADODB.Connection")
  43. 'cn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("data.mdb"))
  44.  
  45. 'dim strSQL
  46.  
  47. 'strSQL = "INSERT INTO Usuarios(Usuario,Clave,Nombre,Domicilio,CP,Telefono,Mail) "
  48. 'strSQL = strSQL & " VALUES('" & Usuario & "','" & Clave & "','"
  49. 'strSQL = strSQL & Nombre & "','" & Domicilio & "','" & CP & "','"
  50. 'strSQL = strSQL & Telefono & "','" & Mail & "')"
  51.  
  52. 'cn.Execute(strSQL)
  53. 'cn.close
  54. 'set cn= nothing
  55. %>
  56.  
  57.  
  58. <html>
  59. <title>Graba Solicitud de Compra</title>
  60. <body>
  61.  
  62. <html>
  63. <title>Graba Solicitud de Comp</title>
  64. <p>&nbsp;</p>
  65. <table width="45%" border="0" align="center" cellpadding="0" cellspacing="0" >
  66. <tr>
  67.     <td width="50%" align="center"><input type="button" class="boton" value="Volver" onClick="window.location.href='solicitud_compra.asp';"></td>
  68.     </tr>   
  69. </table>
  70. </body>
  71. </html>
  72.  
  73. <%
  74. 'end if
  75.  
  76. 'else
  77. ' ErrMsg = ""
  78. ' zz=vererror(ErrMsg,"Sin Conexión a Intranet")
  79. ' response.end
  80. 'end if
  81. %>


FORMULARIO:GrabaAlumnos.asp

necesito  guardar un dato cesar
  • 0




IP.Board spam blocked by CleanTalk.