Ver Mensaje Individual
  #2 (permalink)  
Antiguo 23/07/2009, 09:46
piano_bar
 
Fecha de Ingreso: julio-2009
Mensajes: 14
Antigüedad: 15 años, 9 meses
Puntos: 0
Respuesta: llamar a procedimientos

vuelvo a poner el codigo con el resaltador de codigo

Código asp:
Ver original
  1. <&#37;
  2. Function AbrirConexion()
  3. Dim Conexion
  4. adOpenKeyset = 1
  5. adLockOptimistic = 3
  6. Set Conexion = Server.CreateObject("ADODB.Connection")
  7. Conexion.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=lachc$InetpubwwwrootQuinielaDBTragaMonedas. mdb"
  8.  
  9. Set AbrirConexion = Conexion
  10. End Function
  11.  
  12. Function DevolverRecordset(strSQL)
  13. Dim Rs
  14. Set Rs = Server.CreateObject("ADODB.Recordset")
  15.  
  16. Rs.Open strSQL, cn, 3, 1
  17.  
  18. Set DevolverRecordset = Rs
  19. End Function
  20.  
  21. Sub ExecutarConsulta(strSQL)
  22. Dim Rs
  23. dim cn
  24. Set Rs = Server.CreateObject("ADODB.Recordset")
  25.  
  26. set cn = AbrirConexion
  27. Rs.Open strSQL, cn, 3, 1
  28. End Sub
  29.  
  30. %>
  31. <script>
  32.  
  33. function checkValores()
  34. {
  35. var rta;
  36.  
  37. rta = true;
  38. if (!IsNumeric(document.getElementById("serie").value )){
  39. alert("los valores a ingresar deben ser numericos");
  40. rta = false;
  41. }
  42.  
  43. return rta;
  44. }
  45.  
  46. function IsNumeric(sText)
  47. {
  48. var ValidChars = "0123456789.";
  49. var IsNumber=true;
  50. var Char;
  51.  
  52.  
  53. for (i = 0; i < sText.length && IsNumber == true; i++)
  54. {
  55. Char = sText.charAt(i);
  56. if (ValidChars.indexOf(Char) == -1)
  57. {
  58. IsNumber = false;
  59. }
  60. }
  61. return IsNumber;
  62. }
  63.  
  64. function guardarConfiguracion()
  65. {
  66. if (checkValores())
  67. {
  68. //guardo los valores en la tabla
  69. var sql;
  70.  
  71. sql = "INSERT INTO CONFIGURACIONES (Serie, Ganadores, Bonus)";
  72. sql += "VALUES(";
  73. sql += document.getElementById("serie").value + ", ";
  74. sql += document.getElementById("ganadores").value + ", ";
  75. sql += document.getElementById("bonus").value + ")";
  76.  
  77. ExecutarConsulta(sql)
  78. }
  79. }
  80.  
  81. function cargarConfiguracion()
  82. {
  83. document.getElementById("serie").value = "15";
  84. document.getElementById("ganadores").value = "8";
  85. document.getElementById("bonus").value = "5";
  86. }
  87. </script>