Cita:
Iniciado por a n g e l u s EN REALIDAD LO QUE HACES NO ES CONVENIENTE, LA BUSQUEDA POR ID NO TE CONVIENE, TE SUGUIERO ALGUN NUMERO DE ASIGNACION O ALGO ASI, PERO AQUI ESTA TU RESPUESTA....
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>buscar</title>
<style type="text/css">
<!--
body,td,th {
color: #FFFFFF;
}
body {
background-color: #003333;
}
-->
</style></head>
<body>
<form name="form2" method="post" action="">
<div align="center">
<input type="submit" name="Submit" value="Buscar">
<input type="text" name="buscado">
</div>
</form>
<p> </p>
<hr>
<%
if request("buscado") <> "" then
dim conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.ConnectionString ="driver=SQL Server;server=DESARROLLO;uid=prueba;pwd=prueba;dat abase=EXTERNA"
conn.Open
sql = "select * from prueba where id= "& request("buscado")
set rs = conn.execute(sql)
if not rs.eof then
%>
<form id="form1" name="form1" method="post" action="">
<label><br>
ID
<input type="text" name="txtid" value='<% =rs("id") %>'/>
</label>
<div align="left"></div>
<p align="left">NOMBRE
<input type="text" name="txtnombre" value='<% =rs("nombre") %>'/>
PUESTO
<input type="text" name="txtpuesto" value='<% =rs("puesto") %>'/>
AREA
<input type="text" name="txtarea" value='<% =rs("area") %>'/>
</p>
<p>TELEFONO
<input type="text" name="txttelefono" value='<% =rs("telefono") %>'/></p>
SUELDO
<input type="text" name="txtsueldo" value='<% =rs("sueldo") %>'/>
FECHA
<input type="text" name="txtfecha" value='<% =rs("fecha_ingreso") %>'/>
TURNO
<input type="text" name="txtturno" value='<% =rs("turno") %>'/>
</form>
<%
else
response.write "<center>Datos no encontrados</center>"
end if
else
response.write "<center>Ingrese un numero a buscar</center>"
end if
%>
</body>
</html>
Disculpa por volver a molestar ya estuve probando la busqueda que me diste y la cambie para que me de el folio que es strin en vez del ID ahora tengo una pregunta en la pantalla agrege otro text fiel debajo del boton de busqueda para agregar otro criterio de busqueda que al oprimir el boton de busqueda tome el valor abuscar ya sea del folio en el text fiel1 o el valor del id en el text fiel 2 con el mismo boton no se si aqui se pueda usar algun case o algo asi pues yo lo usaba con vb el codigo que tengo en la pantalla es este
<%
DIM conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.ConnectionString ="driver=SQL Server;server=DESARROLLO;uid=prueba;pwd=prueba;dat abase=EXTERNA"
conn.Open
DIM sql
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>base</title>
<style type="text/css">
<!--
body,td,th {
color: #FFFFFF;
}
body {
background-color: #003366;
}
-->
</style></head>
<body>
<form name="form2" method="post" action="">
<div align="center">
<p>
<input type="submit" name="Submit" value="Buscar">
</p>
<p>Folio
<input type="text" name="buscado">
ID
<input name="id" type="text" id="id">
</p>
</div>
</form>
<%
select case request
case "buscado"
sql = "select * from prueba where folio like '"& request("buscado") &"'"
set rs = conn.execute(sql)
case "id"
sql = "select * from prueba where folio like '"& request("id") &"'"
set rs = conn.execute(sql)
end select
if not rs.eof then
%>
<p> </p>
<p> </p>
<form id="form1" name="form1" method="post" action="">
<label>ID
<input type="text" name="txtid" value='<% =rs("folio") %>'/>
</label>
NOMBRE
<input type="text" name="txtnombre" value='<% =rs("nombre") %>'/>
PUESTO
<input type="text" name="txtpuesto" value='<% =rs("puesto") %>'/>
AREA
<input type="text" name="txtarea" value='<% =rs("area") %>'/>
<p>TELEFONO
<input type="text" name="txttelefono" value='<% =rs("telefono") %>'/></p>
SUELDO
<input type="text" name="txtsueldo" value='<% =rs("sueldo") %>'/>
FECHA
<input type="text" name="txtfecha" value='<% =rs("fecha_ingreso") %>'/>
TURNO
<input type="text" name="txtturno" value='<% =rs("turno") %>'/>
</form>
<form name="form2" method="post" action="">
<div align="center"></div>
</form>
<%
else
response.write "<center>Datos no encontrados</center>"
end if
%>
</body>
<%
Set rs = Nothing
conn.Close
Set conn = Nothing
%>
</html>
pero usando el case asi me aroja error no se si lo este usando adecuadamente