Hola, vere si puedo explicarme:
TU al principio declaras la variable num_serie3_1 y hasta ese momento viene vacia.
Lo que por logica cuando llega a este if
Si va entrar
Adentro de ese if, esta primero
Código asp:
Ver originalnum_serie3_1 = request.Form("text1")
Lo que hace que vuelvas a meter un valor vacio en num_serie3_1
Despues al igual dentro del if viene tu insert
Código asp:
Ver originalSQL3_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 & "')"
Lo cual por logica mete los valores a vacio.
Eso es por q los mete, una solucion seria hacer esto haber si te sirve:
Código asp:
Ver original<%@LANGUAGE="VBSCRIPT"%>
<script language="vbscript" runat="server">
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
</script>
<head>
<style type="text/css">
H1 {border-width: 1; border: solid; text-align:center}
</style>
<title>EMPRESA S.A.</title>
<style type="text/css">
<!--
body,td,th {
font-size: 12px;
color: #000000;
}
body {
background-color: #FFFFFF;
background-image: url();
background-repeat: no-repeat;
background-position:center;
}
.Estilo2 {font-size: 14px}
.Estilo3 {
font-size: 18px
}
.Estilo5 {font-size: 18px; font-weight: bold; }
.Estilo4 {
font-size: 14;
font-weight: bold;
}
-->
</style>
</head>
<body>
<div align="center">
<p><img src="forosdelweb.com/images/empresa.JPG" width="262" height="76"> </p>
<p class="Estilo3">Información Tráfico De Celulares</p>
<p class="Estilo3">Empresa S.A.</p>
<p class="Estilo4">Ingreso de un Nuevo Celular</p>
</div>
<p> </p>
<p> </p>
<%
Dim valor
valor = Request.QueryString("valor")
if num_serie3_1 = "" then
%>
<form method="Post" action="agregacelular.asp?valor=1">
<table width="308" border="2" align="center" cellpadding="1" cellspacing="0" name="tabla">
<tr><td colspan=2 align="center" class="Estilo5">Agregar Nuevo CELULAR</td>
</tr>
<tr><td colspan="2" height=5></td></tr>
<tr>
<td width="38%" nowrap class="Estilo4">Número de Serie:</td>
<td colspan="2">
<input name ="text1" size="25" maxlength="15"><BR>
</td>
</tr>
<tr>
<td width="38%" nowrap class="Estilo4">Equipo:</td>
<td colspan="2">
<input name="text2" size="25" maxlength="20"><BR>
</td>
</tr>
<tr>
<td width="38%" nowrap class="Estilo4">Modelo:</td>
<td colspan="2">
<input name="text3" size="25" maxlength="10"><BR>
</td>
</tr>
<tr>
<td width="38%" nowrap class="Estilo4">Mac:</td>
<td colspan="2">
<input name="tetx4" size="25" maxlength="17"><BR>
</td>
</tr>
<tr>
<td width="38%" nowrap class="Estilo4">Pin:</td>
<td colspan="2">
<input name="text5" size="25" maxlength="8"><BR>
</td>
</tr>
<tr>
<td width="38%" nowrap class="Estilo4">Accesorios</td>
<td colspan="2">
<input name="text6" size="25" maxlength="200"><BR>
</td>
</tr>
<tr>
<td width="38%" nowrap class="Estilo4">Fecha Entrega Celular</td>
<td colspan="2">
<input name="text7" size="25" maxlength="10"><BR>
</td>
</tr>
<tr>
<td width="38%" nowrap class="Estilo4">Fecha Retiro Celular</td>
<td colspan="2">
<input name="text8" size="25" maxlength="10"><BR>
</td>
</tr>
<tr>
<td width="38%" nowrap class="Estilo4">Asignado</td>
<td colspan="2">
<input name="text9" size="25" maxlength="50"><BR>
</td>
</tr>
<tr>
<td width="38%" nowrap class="Estilo4">No Asignado</td>
<td colspan="2">
<input name="text10" size="25" maxlength="50"><BR>
</td>
</tr>
<tr>
<td width="38%" nowrap class="Estilo4">Notas</td>
<td colspan="2">
<input name="text11" size="25" maxlength="200"><BR>
</td>
</tr>
<tr>
<td colspan="6" align="center">
<input type="Submit" value=" Agregar " onClick="return window.confirm('Desea Ingresar el registro')">
</td>
<td width="13%"></td>
</tr>
</table>
<%end if%>
<%
if valor = 1 then
num_serie3_1 = request.Form("text1")
equipo3_1 = request.Form("text2")
modelo3_1 = request.Form("text3")
mac3_1 = request.Form("text4")
pin3_1 = request.Form("text5")
accesorios3_1 = request.Form("text6")
fecha_entrega_celular3_1 = request.Form("text7")
fecha_retiro_celular3_1 = request.Form("text8")
asignado3_1 = request.Form("text9")
no_asignado3_1 = request.Form("text10")
notas3_1 = request.Form("text11")
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 & "')"
set obj_conn3_1=server.createobject("ADODB.connection")
obj_conn3_1.open "PRUEBA"
obj_conn3_1.execute sql3_1
obj_conn3_1.Close
set obj_conn3_1 = Nothing
end if
%>
</form>
<p align="center"> </p>
<td width="50%" height="1" align="left"><form method="POST" name="Volver" action="principal.asp">
<p align="center">
<input type="submit" value=" Página Principal " name=" volver ">
</p>
</form></td>
<td width="50%" height="1" align="left"><form method="POST" name="paginachip" action="celular.asp">
<p align="center">
<input type="submit" value=" Página Celular " name=" paginachip ">
</p>
</form></td>
<p align="center"> </p>
<p align="center" class="Estilo2">Volver a página Inicio EMPRESA</p>
<p align="center"><a href="paginaempresa.cl/default.aspx" target="_self" class="Estilo2">paginaempresa.cl</a></p>
<p align="center"> </p>
</body>
</html>
Ya solo seria cosa de adecuarlo y ponerlo bonito, pero analiza lo que hice de esa forma solo insertaria cuando ya trae valores