Simulador (Cuando presiona el botón "ejecutar el programa"
se graban todos los cuadros de texto y se ejecuta el primero de la lista
mostrando en una página el resultado)
Problema:
<html>
<head>
<title>problema</title>
</head>
<body>
<form action="pagina1.asp" method="post">
<h2>Consulta de artículos en un rango de valores</h2>
Precio inferior:
<input type="text" name="precio1" size="6"><br>
Precio superior:
<input type="text" name="precio2" size="6"><br>
<input type="submit" value="Buscar"><br>
</form>
</body>
</html>
<%option explicit%>
<html>
<head>
<title>problema</title>
</head>
<body>
<%
dim conexion
set conexion = Server.CreateObject("ADODB.Connection")
conexion.ConnectionString = "Provider=SQLOLEDB.1;" & _
"Data Source=.;" & _
"Integrated Security=SSPI;" & _
"Persist Security Info=False;" & _
"Initial Catalog=wi630629_aspya"
conexion.Open
dim registros
set registros = Server.CreateObject("ADODB.RecordSet")
registros.open "select codigo,descripcion,precio from articulos where " _
& "precio>=" & request.form("precio1") & " and precio<=" _
& request.form("precio2") ,conexion
do while not registros.eof
response.write("Código:" & registros("codigo"))
response.write("<br>")
response.write("Descripción:" & registros("descripcion"))
response.write("<br>")
response.write("Precio:" & registros("precio"))
response.write("<br>")
response.write("------------------------------------------------------------")
response.write("<br>")
registros.movenext
loop
conexion.close
%>
</body>
</html>