Connect til DB
Hejsa ng.Gunder manglende forstand kan jeg ikke få denne kode til at virke:
<%
-----HER FRA----
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="& Server.Mappath("../../db/anmeld.mdb")
Set objConn = Server.CreateObject ("ADODB.Connection")
objConn.Open strConnect
-----HER TIL----
---Resten er ok---
Sql = "SELECT * FROM anmeld"
rs.Open Sql, Conn, 1
antalRandom = 7
inDB = rs.RecordCount
If inDB > antalRandom then
Randomize timer
newId = Int (rnd*inDB)
strIndex = "," & newid & ","
indexFound = 1
Do while indexFound < antalRandom
Do
Newid = Int (rnd*inDB)
Loop while inStr(strIndex,"," & newid & ",") > 0
strIndex = strIndex & newid & ","
indexFound = indexFound + 1
Loop
strIndex = mid (strIndex,2,len(strIndex)-2)
myArr=split(strIndex,",",-1)
For i = Lbound(myArr) to Ubound(myArr)
rs.move myArr(i),1
Response.Write("<td><a class='link' href='bioreview.asp?mode=teather&id=" & rs("id") & "' title='" & rs("titel") & "'><img src='pics/" & rs("pic") & "' border='0' width='70' height='99' alt='" & rs("titel") & "'></a></td><td width='4'></td>")
next
end if
Rs.Close
Conn.Close
Set Rs = Nothing
Set Conn = Nothing
%>
