Here is the original code from Drew, make sure you enter you MS SQL DB specifics. I use this code and it works great, thanks for a guy name Drew AKA MadDog :)
<%
'****************************************************************************************
'** Copyright Notice
'**
'** iPortalX.net
'**
'** Copyright 2001-2003 Drew Gauderman All Rights Reserved.
'**
'** This program is a free software; you can modify (at your own risk) any part of it
'** under the terms of the License that accompanies this software and use it both
'** privately and commercially.
'**
'** You may use parts of this program in your own private work, and you may NOT
'** redistribute, repackage, or sell the whole or any part of this program even
'** if it is modified or reverse engineered in whole or in part without express
'** permission from the author.
'**
'** You may not pass the whole or any part of this application off as your own work.
'**
'** This program is distributed in the hope that it will be useful,
'** but WITHOUT ANY WARRANTY; without even the implied warranty of
'** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR ANY OTHER
'** WARRANTIES WHETHER EXPRESSED OR IMPLIED.
'**
'** Questions are NOT answered by e-mail ever!
'**
'** If you have problems please visit:-
'** www.iportalx.net
'**
'** For correspondence or non support questions contact: -
'** drew@aspinvision.com
'**
'****************************************************************************************
%>
<style type="text/css">
<!--
.text {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12; color: black;}
a {font-family: Verdana, Arial, Helvetica, sans-serif, Verdana, Arial, Helvetica, sans-serif; color: blue; font-size: 12; text-decoration: none;}
a:hover {font-family: Verdana, Arial, Helvetica, sans-serif; color: blue; font-size: 12; text-decoration: underline;}
a:visited {font-family: Verdana, Arial, Helvetica, sans-serif; color: blue; font-size: 12; text-decoration: none;}
a:visited:hover {font-family: Verdana, Arial, Helvetica, sans-serif; color: blue; font-size: 12; text-decoration: underline;}
-->
</STYLE>
<table cellpadding="3" cellspacing="1" width="200" bgcolor="black" class="text">
<tr>
<td bgcolor="white" align="center" height="15"><b>latest 15 posts</b></td>
</tr>
<tr>
<td bgcolor="white" height="25">
<%
'//----------------------------------------------------------
'// Declare variables
'//----------------------------------------------------------
Dim rsLastestPostsMod
Dim adoLastestPostsModCon
Dim strLastestPostsModCon
Dim strSQLLastsPostsMod
Dim strLastestPostsModTopicSubject
Dim strLastestPostsModForumPath
Dim intLastestPostsTotal
Dim intHowManyChars
'The path to the forum
strLastestPostsModForumPath = "/forum/"
'How many new topics to show
intLastestPostsTotal = 6
'How many characters should be showed before the subject is cut off
intHowManyChars = 22
'//----------------------------------------------------------
'//----------------------------------------------------------
'// Database connection
'//----------------------------------------------------------
'Default connection
'strLastestPostsModCon = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/wwforum.mdb")
'Uncomment for a full phsyical path. Then change the path
'strLastestPostsModCon = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=C:\Inetpub\wwwroot\iportalx\iPortalX\_private\portal.mdb"
'Uncomment for a DSN connection
'strLastestPostsModCon = "DSN=DSN_NAME"
'MSSQL Connection
Const strSQLServerName = "localhost"
Const strSQLDBUserName = "sa"
Const strSQLDBPassword = ""
Const strSQLDBName = "iPortalX"
'Uncomment for MSSQL connection. Make sure to enter MSSQL DB Info above!
'The SQLOLEDB driver offers the highest performance at this time for connecting to SQL Server databases from within ASP.
strLastestPostsModCon = "Provider=SQLOLEDB;Server=" & strSQLServerName & ";User ID=" & strSQLDBUserName & ";Password=" & strSQLDBPassword & ";Database=" & strSQLDBName & ";"
'//----------------------------------------------------------
'//----------------------------------------------------------
'// Opens the connection
'//----------------------------------------------------------
Set adoLastestPostsModCon = Server.CreateObject("ADODB.Connection")
adoLastestPostsModCon.Open strLastestPostsModCon
'//----------------------------------------------------------
'//----------------------------------------------------------
'// Opens the recordset for getting the records
'//----------------------------------------------------------
Set rsLastestPostsMod = Server.CreateObject("ADODB.Recordset")
'SQL that checks for permissions so it doesnt show senstive topics
strSQLLastsPostsMod = "SELECT TOP 15 tblThread.Topic_ID, tblThread.Thread_ID, tblThread.Author_ID, tblTopic.Subject, tblTopic.Priority, tblTopic.Locked, tblTopic.Moved_ID, tblTopic.Poll_ID, tblTopic.Last_entry_date, tblTopic.No_of_views, tblForum.Forum_ID, tblForum.Forum_name, tblAuthor.Username " & _
"FROM tblAuthor INNER JOIN (tblForum INNER JOIN (tblTopic INNER JOIN tblThread ON tblTopic.Last_entry_date = tblThread.Message_date) ON tblForum.Forum_ID = tblTopic.Forum_ID) ON tblAuthor.Author_ID = tblThread.Author_ID " & _
"WHERE (tblForum.[Read] <= 1 OR (tblTopic.Forum_ID IN (" & _
" SELECT tblPermissions.Forum_ID " & _
" FROM tblPermissions " & _
" WHERE tblPermissions.Author_ID=1 OR tblPermissions.Group_ID = 2 AND tblPermissions.[Read]=1))" & _
" )" & _
" " & _
"AND tblTopic.Topic_ID = tblThread.Topic_ID ORDER BY tblTopic.Last_entry_date DESC;"
rsLastestPostsMod.Open strSQLLastsPostsMod, adoLastestPostsModCon
'//----------------------------------------------------------
'//----------------------------------------------------------
'// Loop through the records if any
'//----------------------------------------------------------
If rsLastestPostsMod.EOF Then
Response.Write "<span class=""smltext"">No Forum Posts Made</span>"
Else
Do while NOT rsLastestPostsMod.EOF
If len(rsLastestPostsMod("Subject")) > intHowManyChars then
strLastestPostsModTopicSubject = left(decodeString(rsLastestPostsMod("Subject")),intHowManyChars) & "... "
Else
strLastestPostsModTopicSubject = rsLastestPostsMod("Subject")
End If
Response.Write("- <a href=""" & strLastestPostsModForumPath & "forum_posts.asp?TID=" & rsLastestPostsMod("Topic_ID") & "&PN=1"">" & strLastestPostsModTopicSubject & "</a>")
rsLastestPostsMod.MoveNext
If NOT rsLastestPostsMod.EOF Then Response.Write("<br>")
Loop
End If
'//----------------------------------------------------------
'//----------------------------------------------------------
'// Reset Server Objects