Ver Mensaje Individual
  #6 (permalink)  
Antiguo 07/03/2006, 11:33
hunabku
 
Fecha de Ingreso: diciembre-2003
Mensajes: 595
Antigüedad: 21 años, 5 meses
Puntos: 1
Cita:
Iniciado por El_Metallick
si quieres reflejar todos en forma de lista tienes que hacer un ciclo, si no tienes que especificar en tu consulta el id que quieres mostrar, un ejemplo de cada uno:

Ciclo:
Código:
<%
Do While Not rs.Eof
%>
 <form id="form<% = rs("id") %>" name="form<% = rs("id") %>" method="post" action="">
 <label>ID
 <input type="text" name="txtid<% = rs("id") %>" value='<% =rs("id") %>'/>
 </label>
 NOMBRE
 <input type="text" name="txtnombre<% = rs("id") %>" value='<% =rs("nombre") %>'/>
 PUESTO
 <input type="text" name="txtpuesto<% = rs("id") %>" value='<% =rs("puesto") %>'/>
 AREA
 <input type="text" name="txtarea<% = rs("id") %>" value='<% =rs("area") %>'/>
 <p>TELEFONO
 <input type="text" name="txttelefono<% = rs("id") %>" value='<% =rs("telefono") %>'/></p>
 SUELDO
 <input type="text" name="txtsueldo<% = rs("id") %>" value='<% =rs("sueldo") %>'/>
 FECHA
 <input type="text" name="txtfecha<% = rs("id") %>" value='<% =rs("fecha_ingreso") %>'/>
 TURNO
 <input type="text" name="txtturno<% = rs("id") %>" value='<% =rs("turno") %>'/>
</form>
<%
rs.MoveNext
Loop
%>
id fija:
Código:
  <%
    Dim conn As ADODB.Connection
    Dim cmd As ADODB.Command
    Dim rs As ADODB.Recordset  
 
   
    Set conn = Server.CreateObject("ADODB.Connection")  
    set cmd = Server.CreateObject("ADODB.Command")
    set rs = Server.CreateObject("ADODB.Recordset")
    
    
 conn.ConnectionString = "driver=SQL Server;server=DESARROLLO;uid=;pwd=;database=EXTERN A"
    
      conn.CursorLocation = adUseClient
      conn.Open
 	 
       
 
 rs.Open "select * from prueba where id = "2"", conn, adOpenDynamic, adLockOptimistic
  
 
 %>
Espero haber sido claro... saludos y suerte
gracias por la erspuesta pero no lo quisiera en lista solo me gustaria llamar al primer registro ya despues haria una busqueda pero lo que sige sin hacerme es el enlace no se si mi conexion este bien y mi enlace a las text tambien




<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>base de datos</title>
<style type="text/css">
<!--
body,td,th {
color: #FFFFFF;
}
body {
background-color: #006699;
}
-->
</style></head>

<body>



<%
Dim conn As ADODB.Connection
Dim cmd As ADODB.Command
Dim rs As ADODB.Recordset


Set conn = Server.CreateObject("ADODB.Connection")
set cmd = Server.CreateObject("ADODB.Command")
set rs = Server.CreateObject("ADODB.Recordset")

conn.ConnectionString = "driver=SQL Server;server=DESARROLLO;uid=;pwd=;database=EXTERN A"

conn.CursorLocation = adUseClient
conn.Open



rs.Open "select * from prueba ", conn, adOpenDynamic, adLockOptimistic




%>

<form id="form1" name="form1" method="post" action="">
<label>ID
<input type="text" name="txtid" value='<% =rs("id") %>'/>
</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") %>'/>
TURNO
<input type="text" name="txtturno" value='<% =rs("turno") %>'/>
</form>

</body>
</html>