Los Foros de ASPTutor.com
Home | Perfil | Registrarse | Temas Activos | Miembros | Buscar | FAQ
Usuario:
Password:
 Todos los Foros
 ASP
 Conectar formulario html con BD Access con ASP
 Foro Bloqueado  Tema Bloqueado


Autor Temas
carnagu
Starting Member


8 Posts
Mensajes - 05 Dec 2008 :  15:48:32  Ver Perfil  Enviar Email
Muy buenas tardes a todos, y agradezco de antemano al alma caritativa que me pueda brindar su ayuda. Estoy dando mis primeros pasos con esto de la programacion web y me surge este problema, ya lei muchos foros y manuales pero todavia sigo manteniendo el mismo problema, el que paso a comentarles:

Tengo un formulario en HTML (el cual anexo a continuacion) que deseo conectar con una base de datos en Access para grabar en la BD los resultados de los textbox que producen la sumatoria de campos. Leyendo en los foros he notado que la conexion la realizan por medio de ASP o PHP. Mi caso es que el formulario funciona bien, hago el llamado a la pagina en ASP, pero el navegador lo unico que hace es mostrarme el codigo html de esa pagina, no realizando absolutamente nada. ALguien me puede explicar si en el formulario estoy llamando mal a la funcion o si el problema es el codigo en la ASP, porfavor:

<!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>
<!-- #include file="file:C:\adovbs.inc" -->
<SCRIPT LANGUAGE="JavaScript">
function mifuncion(form1){
form1.cap.value=parseInt(form1.tiempo.value)+parseInt(form1.tcap.value);
form1.gba.value=parseInt(form1.tiempo.value)+parseInt(form1.tgba.value);
form1.cor.value=parseInt(form1.tiempo.value)+parseInt(form1.tcor.value);
form1.ros.value=parseInt(form1.tiempo.value)+parseInt(form1.tros.value);
form1.tuc.value=parseInt(form1.tiempo.value)+parseInt(form1.ttuc.value);
form1.mdz.value=parseInt(form1.tiempo.value)+parseInt(form1.tmdz.value);
form1.neu.value=parseInt(form1.tiempo.value)+parseInt(form1.tneu.value);
form1.tblan.value=parseInt(form1.tgb.value)+parseInt(form1.blan.value);
}
</SCRIPT>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- TemplateBeginEditable name="doctitle" -->
<title>Tiempos de la Gestión</title>
<!-- TemplateEndEditable -->
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
<style type="text/css">
<!--

body {
font: 100% Verdana, Arial, Helvetica, sans-serif;
background: #666666;
margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
padding: 0;
text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
color: #000000;
background-color: #F0F0F0;
}

.oneColElsCtrHdr #container {
width: 46em; /* this width will create a container that will fit in an 800px browser window if text is left at browser default font sizes */
background: #FFFFFF;
margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
border: 1px solid #000000;
text-align: left; /* this overrides the text-align: center on the body element. */
}
.oneColElsCtrHdr #header {
background: #FFFFFF;
padding: 0 10px 0 20px; /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
}
.oneColElsCtrHdr #header h1 {
margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
}
.oneColElsCtrHdr #mainContent {
padding: 0 20px; /* remember that padding is the space inside the div box and margin is the space outside the div box */
background: #FFFFFF;
font-family: "Comic Sans MS", cursive;
}
.oneColElsCtrHdr #footer {
padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
background:#DDDDDD;
}
.oneColElsCtrHdr #footer p {
margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
}
.oneColElsCtrHdr #container #mainContent #form1 h1 em {
font-family: Verdana, Geneva, sans-serif;
}
#mainContent #form1 h1 em {
font-family: Verdana, Geneva, sans-serif;
}
.oneColElsCtrHdr #container #mainContent #form1 h1 em {
font-family: Comic Sans MS, cursive;
color: #F00;
}
.oneColElsCtrHdr #container #mainContent #form1 p {
font-family: "Comic Sans MS", cursive;
}
.oneColElsCtrHdr #container #mainContent #form1 p {
font-family: Comic Sans MS, cursive;
text-align: left;
color: #000;
}
.oneColElsCtrHdr #container #mainContent #form1 h1 label {
font-family: "Comic Sans MS", cursive;
color: #000;
font-style: italic;
}
h1 {
color: #CCC;
}
.oneColElsCtrHdr #container #footer {
font-family: Comic Sans MS, cursive;
}
-->

</style></head>


<body class="oneColElsCtrHdr">

<div id="container">
<div id="header">
<input name="imageField" type="image" id="imageField" src="Dibujo.jpg" align="middle" />
<!-- end #header --></div>
<div id="mainContent">
<form id="form1" name="time" method="post" action="registro.asp">
<p>
<label><br />
Gestión Móviles Rojos
<select name="tiempo" size="1" id="tiempo" onchange="mifuncion(time)">
<option value="0">0</option>
<option value="15">15</option>
<option value="30">30</option>
<option value="45">45</option>
<option value="60">60</option>
<option value="75">75</option>
<option value="90">90</option>
<option value="120">120</option>
<option value="150">150</option>
<option value="180">180</option>
<option value="210">210</option>
<option value="240">240</option>
</select>
</label>
<label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gestión Móviles Blancos
<select name="tgb" size="1" id="tgb" onchange="mifuncion(time)">
<option value="0">0</option>
<option value="15">15</option>
<option value="30">30</option>
<option value="45">45</option>
<option value="60">60</option>
<option value="75">75</option>
<option value="90">90</option>
<option value="120">120</option>
<option value="150">150</option>
<option value="180">180</option>
<option value="210">210</option>
<option value="240">240</option>
</select>
</label>
<!-- end #mainContent -->
</p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input name="update" type="submit" id="update" value="Actualizar base de datos" />
<br />
<br />
<table width="606" border="0" id="form1">
<tr>
<td width="174"><label>Capital Federal&nbsp;&nbsp;&nbsp;&nbsp;</label>
<right></right>
</p></td>
<td width="74"><select name="tcap" size="1" id="tcap" onchange="mifuncion(time)">
<option value="0">0</option>
<option value="15">15</option>
<option value="30">30</option>
<option value="45">45</option>
<option value="60">60</option>
<option value="75">75</option>
<option value="90">90</option>
<option value="120">120</option>
<option value="150">150</option>
<option value="180">180</option>
<option value="210">210</option>
<option value="240">240</option>
</select></td>
<td width="133"><input name="cap" type="text" id="cap" size="8" readonly="readonly" align="right"/></td>
<td width="64"><label>Blancos

</label>
</p></td>
<td width="73"><select name="blan" size="1" id="blan" onchange="mifuncion(time)">
<option value="0">0</option>
<option value="15">15</option>
<option value="30">30</option>
<option value="45">45</option>
<option value="60">60</option>
<option value="75">75</option>
<option value="90">90</option>
<option value="120">120</option>
<option value="150">150</option>
<option value="180">180</option>
<option value="210">210</option>
<option value="240">240</option>
</select></td>
<td width="62"><input name="tblan" type="text" id="tblan" size="8" readonly="readonly" /></td>
</tr>
<tr>
<td><label>Gran Buenos Aires&nbsp;&nbsp;</label>
<right></right></td>
<td><select name="tgba" size="1" id="tgba" onchange="mifuncion(time)">
<option value="0">0</option>
<option value="15">15</option>
<option value="30">30</option>
<option value="45">45</option>
<option value="60">60</option>
<option value="75">75</option>
<option value="90">90</option>
<option value="120">120</option>
<option value="150">150</option>
<option value="180">180</option>
<option value="210">210</option>
<option value="240">240</option>
</select></td>
<td><input name="gba" type="text" id="gba" size="8" readonly="readonly" align="right" /></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><label>Córdoba
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label></td>
<td><select name="tcor" size="1" id="tcor" onchange="mifuncion(time)">
<option value="0">0</option>
<option value="15">15</option>
<option value="30">30</option>
<option value="45">45</option>
<option value="60">60</option>
<option value="75">75</option>
<option value="90">90</option>
<option value="120">120</option>
<option value="150">150</option>
<option value="180">180</option>
<option value="210">210</option>
<option value="240">240</option>
</select></td>
<td><input name="cor" type="text" id="cor" size="8" readonly="readonly" align="right"/></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><label>Rosario&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </label></td>
<td><select name="tros" size="1" id="tros" onchange="mifuncion(time)">
<option value="0">0</option>
<option value="15">15</option>
<option value="30">30</option>
<option value="45">45</option>
<option value="60">60</option>
<option value="75">75</option>
<option value="90">90</option>
<option value="120">120</option>
<option value="150">150</option>
<option value="180">180</option>
<option value="210">210</option>
<option value="240">240</option>
</select></td>
<td><input name="ros" type="text" id="ros" size="8" readonly="readonly" align="right"/></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><label>Tucuman
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </label></td>
<td><select name="ttuc" size="1" id="ttuc" onchange="mifuncion(time)">
<option value="0">0</option>
<option value="15">15</option>
<option value="30">30</option>
<option value="45">45</option>
<option value="60">60</option>
<option value="75">75</option>
<option value="90">90</option>
<option value="120">120</option>
<option value="150">150</option>
<option value="180">180</option>
<option value="210">210</option>
<option value="240">240</option>
</select></td>
<td><input name="tuc" type="text" id="tuc" size="8" readonly="readonly" align="right"/></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><label>Mendoza&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </label></td>
<td><select name="tmdz" size="1" id="tmdz" onchange="mifuncion(time)">
<option value="0">0</option>
<option value="15">15</option>
<option value="30">30</option>
<option value="45">45</option>
<option value="60">60</option>
<option value="75">75</option>
<option value="90">90</option>
<option value="120">120</option>
<option value="150">150</option>
<option value="180">180</option>
<option value="210">210</option>
<option value="240">240</option>
</select></td>
<td><input name="mdz" type="text" id="mdz" size="8" readonly="readonly" align="right"/></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><label>Neuquen
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
<label> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label></td>
<td><select name="tneu" size="1" id="tneu" onchange="mifuncion(time)">
<option value="0">0</option>
<option value="15">15</option>
<option value="30">30</option>
<option value="45">45</option>
<option value="60">60</option>
<option value="75">75</option>
<option value="90">90</option>
<option value="120">120</option>
<option value="150">150</option>
<option value="180">180</option>
<option value="210">210</option>
<option value="240">240</option>
</select></td>
<td><input name="neu" type="text" id="neu" size="8" readonly="readonly" align="right"/></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<p>&nbsp; </p>
</div></form>
<div id="footer">
Ultima modificación:
<script language="JavaScript">
document.write(document.lastModified)
</script>
<!-- end #footer --></div>
<!-- end #container --></div>
</body>
</html>

registro.asp (version reducida para que mas o menos entiendan lo que vi en otros foros)

<%@ LANGUAGE=VBScript
capital=Request.form1("cap")
granba=Request.form1("gba")
cordo=Request.form1("cor")
rosa=Request.form1("ros")
tucu=Request.form1("tuc")
mend=Request.form1("mdz")
neuq=Request.form1("neu")
strConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=tiempos.mdb"
Set cn=Server.CreateObject("ADODB.Connection")
cnn.Open strConnectionString
strSQL = "UPDATE Tiempo SET capital WHERE Localidad = 'Capital' ",,adCmdText + adExecuteNoRecords
cnn.Execute strSQL,,adCmdText + adExecuteNoRecords
%>

Desde ya muchisimas gracias y espero puedan ayudarme con este problema. Saludos gigantes!

   
 Foro Bloqueado  Tema Bloqueado
Ir a:
Los Foros de ASPTutor.com Los Foros de ASPTutor.com
Ir al principio de la Página

 Imprimir Tema
 

Descargas de manuales¦ Ejemplos de código ¦ Artículos mas visitados ¦ Envía tu articulo ¦ Foros ¦
  Libro de visitas ¦Crea un enlace con ASPTutor 
 

    © 2001-Hasta hoy  Pedro Rufo Martín  contactar