Ver Mensaje Individual
  #2 (permalink)  
Antiguo 29/09/2003, 12:39
Avatar de Cbas
Cbas
 
Fecha de Ingreso: enero-2002
Ubicación: capital federal
Mensajes: 437
Antigüedad: 23 años, 3 meses
Puntos: 2
Fijate si te sirve algo así...
Lo que hago es pasar a un Array todo el Recordset de la tabla.



sSQL = "SELECT min(ID) FROM tabla"
oRc.Open sSQL, oCOn
nr_min = oRc(0)
sSQL = "SELECT max(ID) FROM tabla"
oRc.Open sSQL, oCOn
nr_max = oRc(0)

sSQL = "SELECT * from tabla"
oRc.Open sSQL, oCOn
arr_oRc = oRc.GetRows

nr_Aleatorio = Int(nr_max * Rnd() + nr_min)

for x=LBound(arr_oRc,2) to UBound(arr_oRc, 2)
if int(arr_oRc(0, x)) = nr_Aleatorio then
exit for
end if
Next

Response.Write "Noticia Aleatoria: " & arr_oRc(0, x)
__________________
La Perfección es enemigo de lo bueno.