If rs blank response.write ""??
jeg bruger dette script til at lave en nyheds rulle tekst, men den fejler hvis dato = date() ikke findes.Der skal ændres på loopet, men hvordan skal det lige se ud??
Dim sTxt, iSpeed, iTop, iLeft, iWidth, iHeight, sHtml1, sHtml2, sHtml4, strSQL,sMarquee
Dim conCurrent
Dim rstCurrent
Set conCurrent = CreateObject("ADODB.Connection")
Set rstCurrent = Server.CreateObject("ADODB.Recordset")
conCurrent.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
"DBQ=D:\DATA\lokale\Miljo_2009\news.mdb"
strSQL = "SELECT * FROM nyheder where dato = date() ORDER BY dato DESC"
Set rstCurrent = conCurrent.Execute(strSQL)
sHtml1 = "<P> <FONT SIZE='-1' COLOR='Black'>"
sHtml2 = "<A HREF='newsdetailtest.asp?ID="
sHtml3 = "'>"
sHtml4 = "</A></FONT></P>"
sTxt = ""
rstCurrent.movefirst
do while not rstCurrent.eof 'I used variables here to try and reduce this long assignment
sTxt = sTxt & sHtml1 & rstCurrent("dato") & " " & sHtml2 & _
rstCurrent("ID") & sHtml3 & rstCurrent("overskrift") & sHtml4
rstCurrent.movenext
loop
iSpeed = 100 ' Speed of Marquee (higher = slower)
iTop = 0 ' Y Location Within Object
iLeft = 0 ' X Location""""
iWidth = 500 ' Width
iHeight = 50 ' Height
'Insert marquee into objects innerHtml Property (in this Case a table cell)
sMarquee="<MARQUEE onmouseover='this.stop();' " & _
"onmouseout='this.start();'direction='up' scrollamount='1' " & _
"scrolldelay='" & iSpeed & "' top='" & iTop & "' left='" & iLeft & _
"' width='" & iWidth & "' height='" & iHeight & "'>" & sTxt & "</MARQUEE>"
conCurrent.close 'Don't forget to clean-up!
set conCurrent = Nothing
%>