Function WriteNews()
Const NumPerPage = 5
Dim Db, Rs
Dim strSQL, strScriptName, strTitle, strText
Dim iCurrentPage, iTotalPages, iCount
strScriptName = Request.ServerVariables("SCRIPT_NAME"
If Request.QueryString("page"

= "" Then
iCurrentPage = 1
Else
iCurrentPage = CInt(Request.QueryString("page"

)
End If
strSQL = "SELECT dbo.News.Title, dbo.News.Author, dbo.News.DateWritten, dbo.News.TimeWritten, " &_
"dbo.News.Text FROM dbo.News ORDER BY dbo.News.id DESC"
Set Db = Server.CreateObject("ADODB.Connection"

Db.ConnectionTimeOut = Application("****_ConnectionTimeout"

Db.Open "Provider=****;User ID=****;Password=****;Initial Catalog=****;Data Source=****;", Application("****_RunTimeUserName"

, Application("****_RunTimePassword"
Set Rs = Server.CreateObject("ADODB.Recordset"

Rs.Open strSQL, Db, 1, 1
If Rs.BOF And Rs.EOF Then
Response.Write("No news? Either a DB problem or a quiet admin."

Else
If Not Rs.EOF Then
Rs.MoveFirst
Rs.PageSize = NumPerPage
iTotalPages = Rs.PageCount
Rs.AbsolutePage = iCurrentPage
End If
If Not iCurrentPage = 1 Then
Response.Write("<center><font size=""1""><a href=""" & strScriptName & "?page=" & iCurrentPage - 1 & """>Next " & NumPerPage & " posts</a> | "

Else
Response.Write("<center><font size=""1"">| "

End If
If Not iCurrentPage = iTotalPages Then
Response.Write("<a href=""" & strScriptName & "?page=" & iCurrentPage + 1 & """>Prev " & NumPerPage & " posts</a></font></center> <br />"

Else
Response.Write("</font></center><br />"

End If
Do While Not Rs.EOF And Count < Rs.PageSize
strTitle = Rs(0)
strTitle = Replace(strTitle, "%@%", "'"
strText = Rs(4)
strText = Replace(strText, "%@%", "'"
Response.Write.Count("<font color=""#000000"" size=""5""><b>" & strTitle & " </b></font>" &_
"<font color=""#123456"" size=""2"">[<a href=""mailto:" & Rs(1) & "@designpeak.com"">" & Rs(1) & "</a>] " & Rs(2) & " - " & Rs(3) & "</font>" &_
"<br />" & CheckEmoticons_Index(strText) & "<br /><br />"
Rs.MoveNext()
Count = Count + 1
Loop
If Not iCurrentPage = 1 Then
Response.Write("<center><font size=""1""><a href=""" & strScriptName & "?page=" & iCurrentPage - 1 & """>Next " & NumPerPage & " posts</a> | "

Else
Response.Write("<center><font size=""1"">| "

End If
If Not iCurrentPage = iTotalPages Then
Response.Write("<a href=""" & strScriptName & "?page=" & iCurrentPage + 1 & """>Prev " & NumPerPage & " posts</a></font></center><br />"

Else
Response.Write("</font></center><br />"

End If
End If
Rs.Close()
Db.Close()
Set Rs = Nothing
Set Db = Nothing
End Function
%>
I need to make that trim the text that it gets from the database to 250 characters, and write the name of the the post as the name of the html link to the full news posting.