
18/11/2004, 06:16
|
| | Fecha de Ingreso: octubre-2003
Mensajes: 49
Antigüedad: 21 años, 6 meses Puntos: 0 | |
Pero pq dices que el objeto no existes, si debes de declararlo antes de abrirlo.
lo q dice trasgukabi me parece correcto y asi lo hago funcionar yo cuando necesito dos tablas de una BD.
si miras este codigo puedes ver como lo tengo definido.
SQL1="SELECT * FROM monitor "
SET Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "string de conexion"
SET RS1 = Conn.Execute(SQL1)
IF NOT RS1.EOF THEN
RS1.MOVEFIRST
DO WHILE NOT RS1.EOF
DOCUMENTO=RS1.FIELDS("CAMPO")
SQL2="SELECT * FROM documentos WHERE DOC_COD="&DOCUMENTO&""
SET Conn2 = Server.CreateObject("ADODB.Connection")
Conn2.Open "string_de_conexion"
SET RS2 = Conn.Execute(SQL2)
IF NOT RS2.EOF THEN
<<CONDICIONES>>
RS1.MOVENEXT
END IF
LOOP
END IF
RS1.CLOSE
CONN.CLOSE
-----------------
EL DO WHILE LO PUEDES HACER EN CUALQUIER LUGAR O INCLUSO EN AMBAS CONSULTAS PERO DEBES DE SABER MUY BIEN EN QUE ESTADO ESTAN LAS VARIABLES Y CUAL TABLA DESEAS RECORRER DE ACUERDO A QUE CRITERIO. |