Hej! Eftersom du frågade samma sak tidigare idag (här: http://www.pellesoft.nu/development/forum/view.asp?msgid=38935&forumid=1&sum=1) undrar jag om det svaret inte hjälpte? Något du inte förstod? Du kan även testa att söka mer eftersom denna frågan har varit upp flera gånger tidigare. Hej!Slumpa information från databasen!
Min databas heter databas.mdb, tabellen heter dikter och fältet heter dikt.
Nu vill ja visa information från "dikt" och då vill ja att de slumpas!
Så här ser min kod ut, hoppas någon kan hjälpa mig!:
<!-- #include virtual="../adovbs.inc" -->
<!------------------------------------ DIKTER --------------------------------------->
<% If Request.Querystring("kat") = "dikter" then %>
<font size="1" face="Verdana, Arial, Helvetica, sans-serif">
<%
Set Connect = Server.CreateObject("ADODB.Connection")
Connect.Open "driver={Microsoft Access Driver (*.mdb)};dbq=c:\inetpub\wwwroot\vackrast\db\databas.mdb"
Set RecSet = Server.CreateObject("ADODB.Recordset")
Addera = "SELECT * FROM dikter"
RecSet.Open Addera, Connect, adOpenStatic, adLockOptimistic
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<SCRIPT LANGUAGE="javascript">
<!--This is one of many scripts which are available at: *---
//--http://www.JavaScript.nu/javascript *---
//--This script is FREE, but you MUST let these lines *---
//--remain if you use this script. *---
function ny_sida(url,width,height)
{
//***---Här kan du ändra fönstrets egenskaper, t.ex. om det ska finnas ett adressfält, en statusrad etc. Testa dig fram för att se vad som ska vara vad. Värdena kan vara "yes" eller "no".
//***-------***************************************************************************************--
egenskaper="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes";
egenskaper+=",width="+width;
egenskaper+=",height="+height;
unik=new Date();
unik=unik.getSeconds()+"_"+unik.getMinutes()+"_"+unik.getHours();
window.open(url,unik,egenskaper);
}
//-->
</SCRIPT>
</head>
<body bgcolor="FFFFFF" text="#FF7979" link="#FF7979" vlink="#FF7979" alink="#FF7979">
<table width="75%" border="0" height="422">
<tr>
<td width="84%" height="14">
<div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif" color="#FF7979">Länken
till denna bild är: </font><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#FF7979"><font size="1">http://www.vackrast.com/bilder.asp?kat=dikter&ID</font><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#FF7979"><font size="1"><%= Recset("ID") %></font></font></font></div>
</td>
<td width="16%" height="14"><font color="#000000"><img src="topplista.gif" width="100" height="25" border="1"></font></td>
</tr>
<tr>
<td width="84%" height="37" valign="top">
<div align="center"><font color="#FF7979"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">','400','400');">INFO</font><br>
<font face="Verdana, Arial, Helvetica, sans-serif" size="1"><br>
</font></font>
<table width="90%" border="1" bgcolor="#000000">
<tr>
<td bgcolor="#FF7979">
<div align="center"><font color="#FF7979"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#FFFFFF">
<%= Recset("dikt") %>
</font></font></div>
</td>
</tr>
</table>
<font color="#FF7979"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">
<br>
</font></font></div>
</td>
<td rowspan="4" width="16%" valign="top" nowrap>
<div align="left"><font size="1" face="Verdana, Arial, Helvetica, sans-serif" color="#000000">
<b><font color="#FF7979">- Tjejer - </font></b><br>
<b><font color="#FF7979">01.</font></b> Anna<br>
<b><font color="#FF7979">02.</font></b> Petra<br>
<b><font color="#FF7979">03.</font></b> Crazy_Girl<br>
<b><font color="#FF7979">04.</font></b> Sexy_sanna<br>
<b><font color="#FF7979">05.</font></b> Frida<br>
<b><font color="#FF7979">06.</font></b> Jessica<br>
<b><font color="#FF7979">07.</font></b> Blond_tjejen<br>
<b><font color="#FF7979">08.</font></b> Miss_world<br>
<b><font color="#FF7979">09.</font></b> Sandy<br>
<b><font color="#FF7979">10.</font></b> Maria<br>
<br>
<b><font color="#FF7979">- Killar - </font></b><br>
<b><font color="#FF7979">01.</font></b> Hassaninho<br>
<b><font color="#FF7979">02.</font></b> Mimoworld<br>
<b><font color="#FF7979">03.</font></b> Pangeman<br>
<b><font color="#FF7979">04.</font></b> Svanne<br>
<b><font color="#FF7979">05.</font></b> Per<br>
<b><font color="#FF7979">06.</font></b> Lagge<br>
<b><font color="#FF7979">07.</font></b> Gnagge<br>
<b><font color="#FF7979">08.</font></b> Mr_Hmar<br>
<b><font color="#FF7979">09.</font></b> Mikael<br>
<b><font color="#FF7979">10.</font></b> Mange<br>
<br>
<br>
<br>
<img src="banner.gif" width="120" height="60" border="1"><br>
<br>
<img src="banner.gif" width="120" height="60" border="1"><br>
<br>
<img src="banner.gif" width="120" height="60" border="1"> </font></div>
</td>
</tr>
<tr>
<td width="84%" valign="top" height="3">
<div align="center"></div>
</td>
</tr>
<tr>
<td width="84%" valign="top" height="2">
<div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#FF7979"><b>Rösta</b><br>
</font> </div>
<form name="form1" method="post" action="">
<div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#FF7979">
<input type="radio" name="radiobutton" value="radiobutton">
1
<input type="radio" name="radiobutton" value="radiobutton">
2
<input type="radio" name="radiobutton" value="radiobutton">
3
<input type="radio" name="radiobutton" value="radiobutton">
4
<input type="radio" name="radiobutton" value="radiobutton">
5
<input type="radio" name="radiobutton" value="radiobutton">
6
<input type="radio" name="radiobutton" value="radiobutton">
7
<input type="radio" name="radiobutton" value="radiobutton">
8
<input type="radio" name="radiobutton" value="radiobutton">
9
<input type="radio" name="radiobutton" value="radiobutton">
10<br>
<b>............................Ful - Vacker...........................</b><br>
</font> </div>
</form>
</td>
</tr>
<tr>
<td width="84%" height="55" valign="top">
<div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#FF7979"><b>Kommentar</b></font>
</div>
<form name="form2" method="post" action="">
<div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#FF7979">
<textarea name="textfield" cols="40" rows="5" style="font-size: 8pt; font-family: verdana, arial"></textarea>
</font> </div>
</form>
<hr noshade>
</td>
</tr>
</table>
<%
RecSet.MoveNext
RecSet.Close
Connect.Close
%>
</body>
</html>
<% End If %>Sv: Slumpa information från databasen!
/JohanSv: Slumpa information från databasen!
Alltså, ja vet inte, ja får det inte till att funka, o därför lade ja upp hela mitt script för att få bättre hjälp!
Hassan