Ver Mensaje Individual
  #9 (permalink)  
Antiguo 27/06/2002, 17:23
almaluz
 
Fecha de Ingreso: diciembre-2001
Mensajes: 262
Antigüedad: 23 años, 5 meses
Puntos: 0
Re: help!!!! reporte de dos tablas

Aqui te dejo otro extracto sacado de un libro.

Código:
 
<HTML>
<TITLE> Sentencias SQL </TITLE>
<BODY>
<!-- #INCLUDE File="ADOVBS.inc" -->

<% 
Set Ob_Conn = Server.CreateObject ("ADODB.Connection")
Set Ob_Command = Server.CreateObject ("ADODB.Command")
Ob_Conn.Open "Tienda"
Ob_Command.ActiveConnection = Ob_Conn
Ob_Command.CommandType = adCmdText
Sql= "SELECT Clientes.Nombre, Direccion, Productos.Nombre, Cantidad "
Sql = Sql & "FROM Clientes, Productos, Pedidos "
Sql = Sql & "WHERE Clientes.Codigo = Pedidos.Codigo AND Pedidos.Referencia = Productos.Referencia"
Ob_Command.CommandText = Sql
SET Ob_RS = Ob_Command.Execute () %>
	
<CENTER>
<TABLE BORDER=1>
<TR>
<TH> NOMBRE </TH>
<TH> DIRECCIÓN </TH>
<TH> PRODUCTO </TH>
<TH> CANTIDAD </TH>

<% DO UNTIL Ob_RS.Eof %>
      <TR>
	<TD> <%= Ob_RS (0) %> </TD>
	<TD> <%= Ob_RS (1) %> </TD>	
	<TD> <%= Ob_RS (2) %> </TD> 
	<TD> <%= Ob_RS (3) %> </TD>
<%	Ob_RS.MoveNext
LOOP 
Ob_RS.Close
Ob_Conn.Close %>
</TABLE>
</CENTER>
</BODY>
</HTML>

Ya nos contaras.


Saludos ;)

<a href="http://www.almaluz.com"><Img src="http://www.almaluz.com/banners/B_almaluz.gif"></a>