Registro aleatorio
Olá pessoal agradeço a quem puder me ajudar, ja tentei varias formas mais
não consegui, gostaria de colocar no cód. abaixo a função randomize
para exibir registros aleatorios sem repeti-los
no exemplo abaixo esta listando 5 registros por vez
agradeço muito a ajuda de vcs
obrigado
<html>
<head>
<title> Listando Itens de uma Tabela </title>
</head>
<body bgcolor="#DE9BFF">
<% Dim nome_carta
Set Conexao = Server.CreateObject("ADODB.Connection")
set rs=server.CreateObject("adodb.recordset")
dbPath = "DBQ=" & Server.Mappath("dados/banco_taro.mdb")
Conexao.Open "DRIVER={Microsoft Access Driver (*.mdb)};" & dbPath
PESQUISAR = "SELECT * FROM tabela"
Set RecSet=Conexao.Execute(PESQUISAR)
Dim Repeat1__numRows
Repeat1__numRows = 5
Dim Repeat1__index
Repeat1__index = 0
RecSet_numRows = RecSet_numRows + Repeat1__numRows
%> <%IF RecSet.EOF then %>
( Banco de Dados vazio!!! )
<% else %>
<table border=1 width="100%" cellpadding="0"> <tr>
<% num = 0
While ((Repeat1__numRows <> 0) AND (NOT RecSet.EOF))
%>
<td width="10%" height="15">
Cod. <%=RecSet("nome_carta")%> </td>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
RecSet.MoveNext()
num = num + 1
if num mod 3 = 0 then response.write "</tr><tr>"
Wend
%>
</tr>
<%RecSet.Movenext%>
</table>
<%end if%>
<%conexao.close %>
</body>
</html>Discussão (7)
Carregando comentários...