---
title: "Slumpa"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/12858-slumpa"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "hacktheplanet"
published: "2001-11-25T20:20:00.000Z"
updated: "2001-11-27T14:04:00.000Z"
replies: 5
views: 256
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/asp/12858-slumpa"
---

# Slumpa

## #1 — hacktheplanet, 2001-11-25T20:20Z

vad är felet på koden den laddas om hela tiden och sidan kraschar??

\[kod\]
\<%
Response.Buffer = True
Set Rs = Server.CreateObject("ADODB.Connection")
DBPath = "DBQ=" & server.mappath("Database/members.mdb")
Rs.Open "DRIVER={Microsoft Access Driver (\*.mdb)}; " & DBPath
Sql = "Select count(\*) as Found from members where not bild = 'Bilder/Medlemmar/ingen.gif'"
Set Record = Rs.Execute(Sql) 
Ialt = Record("found")
Sql = "Select \* from members where not bild = 'Bilder/Medlemmar/ingen.gif'"
record.close
set record = nothing
Set Record = server.createobject("adodb.recordset")
record.cursorlocation = 3
record.open sql,rs
dim bilder(3)
randomize
for i = 0 to 3
found = false
do until false
RandNum = Int(Rnd \* Ialt)
for j = 0 to i - 1
if bilder(j) = RandNum then
found = true
exit for
end if
next
if not found or i = 0 then exit do
loop
bilder(i) = RandNum

record.Movefirst
Record.Move randNum 
Response.Write "\<td\>\<center\>"
Response.Write "\<a href='whois.asp?checkid=" & Record("id") & "'\>\<img src='" & Record("bild") & "' alt='" & Record("username") & Record("username") & "' border = '1' width= '65' height= '77'\>\</a\>"
response.write "\</td\>"
next

record.close
rs.close
%\>
\[kod\]

Permalänk: https://www.webforum.nu/p/12858

## #2 — hacktheplanet, 2001-11-25T20:41Z

LarsG hjälp

Permalänk: https://www.webforum.nu/p/295928

## #3 — Vide, 2001-11-25T20:59Z

LarsG svarar:

Du borde ändra:
do until false

till:
do until found

Permalänk: https://www.webforum.nu/p/295929

## #4 — hacktheplanet, 2001-11-25T21:12Z

fan då slumpas samma bild

Permalänk: https://www.webforum.nu/p/295930

## #5 — jboy_87, 2001-11-26T22:52Z

LarsG hjälp
slumpas samma bild

Permalänk: https://www.webforum.nu/p/295931

## #6 — hacktheplanet, 2001-11-27T14:04Z

LarsG men det slumpas samma bild ju

Permalänk: https://www.webforum.nu/p/295932

---

Tråden på webben: https://www.webforum.nu/amne/asp/12858-slumpa
