Foros del Web » Programando para Internet » ASP Clásico »

Intermedio:asp Y Sql

Estas en el tema de Intermedio:asp Y Sql en el foro de ASP Clásico en Foros del Web. TENGO UN PROBLEMA A LA HORA DE PONER LA CARRERA YA QUE ESE DATO LO JALO DE UNA TABLA CARRERA, COMO LE HAGO PARA DESPLEGARLO ...
  #1 (permalink)  
Antiguo 25/05/2002, 17:51
Avatar de vlah  
Fecha de Ingreso: enero-2002
Mensajes: 254
Antigüedad: 22 años, 5 meses
Puntos: 0
Intermedio:asp Y Sql

TENGO UN PROBLEMA A LA HORA DE PONER LA CARRERA YA QUE ESE DATO LO JALO DE UNA TABLA CARRERA, COMO LE HAGO PARA DESPLEGARLO YA QUE TENGO UNA TABLA ALUMNO Y AHI TENGO LA CLAVE DE LA CARRERA, Y QUIERO JALAR EL NOMBRE DE LA CARRERA EN BASE A LA CLAVE...


<!--#INCLUDE file="openclose/abrir.asp" -->
<%
nick=session("nick")
if session("nick")="" then
response.redirect "principal.asp"
else
temp2="select * From tblAlumno where IdAlumno ='" &nick&"'"
tabla2.open temp2,conexion,2,3,1
temp3="select * from tblAlumMateria where IdAlumno='"&nick&"'"
tabla3.open temp3,conexion,2,3,1
temp4="Select * from tblMateria"
tabla4.open temp4,conexion,2,3,1
end if
response.buffer = true
Func=Request("Func")
response.addheader "pragma","no-cache"
Response.CacheControl = "Private"
Response.Expires = 0
%>
<html>
<head>
<Title>prueba</title>
</head>
<body>
<%Response.write"Bienvenido: "%>
<%Response.Write session("nick")%>
<BR>
<BR>

<%while not tabla2.eof%>
<table>
<TR>
<td width=33%> NOMBRE :</td>
<TD width=33%><%=tabla2("Nombre")%> </TD>
</TR>
<TR>
<TD width=33%> APELLIDO :</TD>
<TD width=33%><%=tabla2("Apellido")%&g t;</TD>
</TR>
<TR>
<td width=33%> FECHA DE NAC. :</td>
<TD width=33%><%=tabla2("FechaNac")%&g t;</TD>
</TR>
<TR>
<td width=33%> CARRERA :</td>
<TD width=33%><%=tabla2("Carrera")%&gt ;</TD>
</TR>
<TR>
<TD WIDTH="33">EMAIL :</TD>
<TD WIDTH=38%><%=tabla2("E-mail")%></TD>
</TR>
<%tabla2.movenext
wend%>
</table>
<BR>
<table>
<TR>
<td width=33%>MATERIA </td>
<td width=33%>Parcial 1</td>
<TD WIDTH=33%>Parcial 2</TD>
<TD WIDTH=33%>Final</TD>
</TR>
</TABLE>
<BR>
<%while not tabla3.eof%>
<TABLE>
<TR>
<TD width=33%><%=tabla3("IdMateria")%& gt;</TD>
<TD width=33%><%=tabla3("parcial1")%&g t;</TD>
<TD width=33%><%=tabla3("parcial2")%&g t;</TD>
<TD width=33%><%=tabla3("final")%> </TD>
</TR>
<%tabla3.movenext
wend%>
<%while not tabla4.eof%>
<%tabla4.movenext
wend%>
  #2 (permalink)  
Antiguo 25/05/2002, 17:58
Avatar de vlah  
Fecha de Ingreso: enero-2002
Mensajes: 254
Antigüedad: 22 años, 5 meses
Puntos: 0
Re: Intermedio:asp Y Sql

NO SE SI ME HAYA EXPLICADO, LO UNICO QUE QUIERO HACER ES JALAR EL "NOMBRE" DE LA CARRERA DE UNA TABLA CARRERA, YA QUE EN LA TABLA ALUMNO PUES SOLO TENGO LA CLAVE DE LA CARRERA.
tblalumno tblCarrera
------------ ---------------
nombre ClaveCarrera
apellido nombreCarrera
ClaveCarrera
Direccion
E-mail

CLAVE NOMBRE
LDEF Lic. EN DERECHO

ESPERO Y ME PUEDAN AYUDAR, YA QUE ESTOY DESESPERADO..
  #3 (permalink)  
Antiguo 25/05/2002, 21:07
Avatar de g_susdaniel  
Fecha de Ingreso: mayo-2001
Ubicación: Frente al Monitor :þ
Mensajes: 995
Antigüedad: 23 años, 1 mes
Puntos: 0
Re: Intermedio:asp Y Sql

agregé un campo a la tabla alumnos, ya ke ninguno de los ke pusiste me parecio apto para clave principal.... y seria algo así...

SELECT tblcarrera.nombrecarrera
FROM tblalumnos INNER JOIN tblcarrera ON tblalumnos.clavecarrera = tblcarrera.clavecarrera;


tienes ke usar el INNER JOIN para la seleccion sobre varias tablas....

<div align=right><embed src="http://www.jesusdaniel.venezuela.com/jd.swf" height=25 width=200 wmode="transparent"></embed><br>Usuario # 3359 en los foros</div>
  #4 (permalink)  
Antiguo 26/05/2002, 13:15
 
Fecha de Ingreso: agosto-2001
Mensajes: 15
Antigüedad: 22 años, 10 meses
Puntos: 0
Re: Intermedio:asp Y Sql

Tambien podrias usar lo sgte:
SELECT B.nombrecarrera
FROM tblalumnos A , tblcarrera B
WHERE
A.clavecarrera = B.clavecarrera



  #5 (permalink)  
Antiguo 26/05/2002, 17:11
Avatar de vlah  
Fecha de Ingreso: enero-2002
Mensajes: 254
Antigüedad: 22 años, 5 meses
Puntos: 0
Re: Intermedio:asp Y Sql


GRACIAS POR HABER CONTESTADO PERO HAY UN DETALLE EN ESTA CONSULTA..

SELECT tblCarreras.NomCarrera FROM tblAlumno INNER JOIN tblCarreras ON tblAlumno.Carrera = tblCarreras.IdCarrera &lt;---ESTE ULTIMO DATO PUES ES DONDE ESTA EL DETALLE, YA QUE tblCarrera.Idcarrera ya que este proviene de otra tabla de la cual hago otra consulta, como le hago para hacer para hacer de una consulta sobre otra..

espero opiniones..gracias!!
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 21:21.