Okay, her kommer hele koden!
Response.Write "<table>"
Dim cn, cnstr
set cn = server.createobject("adodb.connection")
cnstr = "Provider=Microsoft.Jet.OLEDB.4.0;"
cnstr = cnstr & "Data Source=" & server.mappath("db.mdb") & ";"
cn.connectionstring = cnstr
cn.open
Dim intMaxColumn, intBilleder, intCount, x, antal, fest
fest = Request.Querystring("fest")
set rs = server.createobject("adodb.recordset")
sql = "select count(*) as antal from img where fest = "&fest&""
rs.open sql, cn
antal = rs.fields("antal")
rs.close
sql = "Select * from img WHERE fest = "&fest&" ORDER BY id ;"
'sql = "SELECT * FROM img ORDER BY id;"
rs.open sql, cn
Do while not (rs.BOF or rs.EOF)
If rs.fields("fest") <> fest Then
antal = antal - 1
End If
rs.movenext
Loop
'Response.Write sql
'Response.Write fest
intMaxColumn = 2 'maximum antal billeder i hver række
intBilleder = antal 'antallet af billeder
intCount = 0 'Tæller
Response.Write "<tr>"
For x = 1 to intBilleder
intCount = intCount+1
If intCount > intMaxColumn Then
intCount = 1
Response.Write "</tr><tr><td height=""15""></td></tr>"
End If
Response.Write "<td><a href=""#"" onclick=""newwin=window.open('../asp/vispics.asp?vis="&rs.fields("id")&"','html','toolbar=1,status=1,width=600, height=500, scrollbars=1');"">" _
& "<img width=""200"" border=""0"" height=""150"" src="""&rs.fields("imgsrc")&""" alt="""&rs.fields("kommentar")&"""></a>" _
& "<br><div class=""text"">("&x&") Tip en ven: <a href=""#"" onclick=""newwin=window.open('../asp/tipven.asp?mode=sms&tip=Tjek+dette+link+ud:
www.fiddle.dk','sms','toolbar=1,status=1,width=600, height=300, scrollbars=1');"">SMS</a> | <a href=""#"" onclick=""newwin=window.open('../asp/tipven.asp?mode=mail&tip=Tjek+dette+link+ud: [a href=546http://www.fiddle.dk546]www.fiddle.dk[/a]','mail','toolbar=1,status=1,width=600, height=300, scrollbars=1');"">Mail</a><br>"&rs.fields("kommentar")&VbCrlf&"</div></td><td width=""15""></td>"
rs.movenext
Next
Response.Write "</table>"
rs.close
set rs = nothing
cn.close
set cn = nothing
Jeg har indsat erikjacobsens forslag...