Jump to content
Fórum Script Brasil
  • 0

Problemas no Randonize MySQL+ASP


Helinho

Question

Olá estou querendo fazer um banner rotativo com o código abaixo mas não consigo fazer funcionar em função do "Conjunto de linhas não oferecer suporte para busca regressiva". Segue abaixo o código para alguém me dizer onde estou errando.

<%
Dim RSbanner
Dim RSbanner_cmd
Dim RSbanner_numRows

Set RSbanner_cmd = Server.CreateObject ("ADODB.Command")
RSbanner_cmd.ActiveConnection = conexao
RSbanner_cmd.CommandText = "SELECT * FROM mysql.banners" 
RSbanner_cmd.Prepared = true

Set RSbanner = RSbanner_cmd.Execute
RSbanner_numRows = 0



Response.Expires = -1000

Dim rndMax,rndNumber

rndMax = CInt(RSbanner.RecordCount)
RSbanner.MoveFirst
Randomize Timer
rndNumber = Int(RND * rndMax) 
RSbanner.Move rndNumber

response.write "<a href='" & RSbanner("link") & "' target='_blank'><img border=0 width='190' height='390' src='img\banners\" & RSbanner("foto") & "'></a>"



RSbanner.Close()
Set RSbanner = Nothing
%>

O erro está apontando para a linha 23 "RSbanner.Move rndNumber". O quê devo fazer?

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...