Ver Mensaje Individual
  #14 (permalink)  
Antiguo 13/06/2007, 11:51
Avatar de Uefor
Uefor
 
Fecha de Ingreso: agosto-2006
Ubicación: Murcia
Mensajes: 136
Antigüedad: 18 años, 9 meses
Puntos: 0
Re: Consulta de dos tablas por registros (select depen)

El caso es que me sonaba la expresión , es lo mismo que reiterar pero sin re ...

El código del formulario ahora mismo lo tenemos así:
Código:
<form name=formulario>
 <p align="left"><strong>N&ordm; Salida:</strong>

<select name=IdSalidas class="fc_main" onChange="location.href('vis_listas2.asp?IdSalidas=' + formulario.IdSalidas.options[formulario.IdSalidas.selectedIndex].value)">
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open = MM_cnx_salidas_STRING

Dim RS_insc, SQL_insc, IdSalidas

SQL_insc="select IdSalidas from salidas order by IdSalidas asc"
IdSalidas = request.querystring("IdSalidas")
set RS_insc = createobject("ADODB.Recordset")
set RS_insc = Conn.execute(SQL_insc)

if RS_insc.EOF then
     response.write("<option value=="""">-- No hay datos --</option>")
else
do while not RS_insc.eof
    response.write("<option value="""&RS_insc("IdSalidas")&"""")
     if IdSalidas = RS_insc("IdSalidas") then response.Write(" selected")
    response.Write(">"&RS_insc("IdSalidas")&"</option>")
    RS_insc.movenext
    loop
    end if

    RS_insc.close
    set RS_insc = nothing
%>
</select>
<%
    if IdSalidas <> "" then %>
     
<%  Dim RS_dat, RS_buzos
    Dim SQL_dat, SQL_buzos
 
    SQL_dat="select * from salidas where IdSalidas="&IdSalidas&" order by Fecha asc"
    set RS_dat=createobject("ADODB.Recordset")
    RS_dat.open SQL_dat,conn
    if not RS_dat.eof then    
%> 

  
  &nbsp;&nbsp;Fecha: 
      <input type="text" class="fc_main" value="<%=RS_dat("Fecha")%>" size="15" readonly="true">
  &nbsp;&nbsp;Hora: 
      <input type="text" class="fc_main" value="<%=RS_dat("Hora")%>" size="11" readonly="true">
  &nbsp;&nbsp;Lugar: 
      <input type="text" class="fc_main" value="<%=RS_dat("Destino")%>" size="25" readonly="true">
  &nbsp;&nbsp;Barco:
      <input type="text" class="fc_main" value="<%=RS_dat("Barco")%>" size="17" readonly="true"><br><br>
  <strong>Incidencias:</strong> 
      <input type="text" class="fc_main" value="<%=RS_dat("Incidencias")%>" size="35" readonly="true">
</p>

<%  end if
RS_dat.close
set RS_dat = nothing
%>

<strong>Buceadores:</strong><br>
  
<%        SQL_buzos="select * from buzos_incl where IdSalidas="&IdSalidas&" order by Socio asc"
        set RS_buzos=createobject("ADODB.Recordset")
        RS_buzos.open SQL_buzos,conn
        do while not RS_buzos.eof   %>
 
      <input type="text" class="fc_main" value="<%=RS_buzos("Socio")%>" size="8" readonly="true">
&nbsp;&nbsp;
      <input type="text" class="fc_main" value="<%=RS_buzos("Nombre")%>" size="50" readonly="true">
&nbsp;&nbsp;
      <input type="text" class="fc_main" value="<%=RS_buzos("DNI")%>" size="10" readonly="true">
&nbsp;&nbsp;
      <input type="text" class="fc_main" value="<%=RS_buzos("TIT")%>" size="20" readonly="true">
       <br />
  
<%
    RS_buzos.movenext
    loop
    RS_buzos.close
    set RS_buzos = nothing
%>
<% end if 
Conn.close()
Set Conn = nothing
%>     
</form>