NEWS
<%
Function limitaCaratteri(frase, lunghMax)
dimMax = LEN(frase)
if dimMax > lunghMax then
estrattoBreve = ""
ultimoCarattere = "a"
contatore = lunghMax
while ultimoCarattere <> " "
estrattoBreve = LEFT(frase,contatore)
ultimoCarattere = RIGHT(estrattoBreve,1)
contatore = contatore - 1
if contatore = 0 then
ultimoCarattere = " "
end if
wend
if contatore <> 0 then
estrattoBreve = LEFT(frase,contatore) & "..."
else
estrattoBreve = LEFT(frase,lunghMax)
end if
else
estrattoBreve = frase
end if
limitaCaratteri = estrattoBreve
End Function
dbPath = server.mapPath("../database/WM1.mdb")
dbConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="& dbpath
dim objConn
set objConn = server.createObject("ADODB.Connection")
objConn.open dbConnString
strSql = "SELECT * FROM news ORDER BY ordine DESC"
set rs = server.createObject("ADODB.Recordset")
rs.open strSql, objConn, 1, 3
if not rs.eof then
do while not rs.eof %>

<%=rs("data")%>
<%=rs("titolo")%>
<% Response.Write limitaCaratteri(rs("testo"), 100)&"
" %>
<%
rs.moveNext
loop
end if
rs.close
set rs = nothing
%>