Ver Mensaje Individual
  #10 (permalink)  
Antiguo 21/09/2006, 13:22
Avatar de JuanRAPerez
JuanRAPerez
Colaborador
 
Fecha de Ingreso: octubre-2003
Mensajes: 2.393
Antigüedad: 21 años, 6 meses
Puntos: 27
mi idea es:
Tus tablas

Cita:
Data_regiones
Id_region
Region
Id_pais

Data_poblaciones
id_pueblo
poblacion
Id_region
haces tus consulta
Cita:
sql "select * from Data_regiones order by Id_region ASC"
Set RS = oConnPrincipal.Execute(SQL)
if RS.bof and RS.eof then
'no hacemos nada
else
'hacemos algo
Do While Not RS.EOF
'imprimimos el nombre de la ragion
id_region = RS("id_region")
sql2 "select * from Data_poblaciones where id_region = "& id_region &" order by Id_pueblo ASC"
Set RS2 = oConnPrincipal.Execute(SQL2)
if RS2.bof and RS2.eof then
'no hacemos nada
else
'empezamos a mostrar
Do While Not RS2.EOF
'imrpimimos nombres de los pueblos
RS2.MoveNext
Loop
end if
RS2.Close
set RS2 = nothing
RS.MoveNext
Loop
end if
RS.Close
set RS = nothing
__________________
JuanRa Pérez
San Salvador, El Salvador