Ver Mensaje Individual
  #3 (permalink)  
Antiguo 17/02/2005, 10:22
Avatar de markshock
markshock
 
Fecha de Ingreso: abril-2004
Ubicación: Allí, al fondo a la izqui
Mensajes: 316
Antigüedad: 21 años
Puntos: 0
A lo mejor esto soluciona vuestras dudas...

Código:
Randomize

SELECT count(id_reg) as total FROM tabla 

total_reg = rs("total").value

aleatorio = int(rnd()*total_reg)+1

x = 1
For x=1 to total_reg-1
 if not rs.eof then
   rs.movenext
 end if
Next
con esto que hacemos, cogemos el total de registros, a partir de este generamos un aleatorio y luego nos movemos con el recorset con el movenext hasta la posicion, si despues queremos volver a crear otro aleatorio solamente hemos de hacer otro Int((rnd()*total)+1) y un rs.movefirst, y volver ha hacer el for...

espero haber ayudado.
__________________
Señoooraaaa!! Que camisetas!!!

"Hay 10 tipos de personas, las que piensan en binario y las que no"
_________________________________