whatup everyone I have some code that I think could be made faster. I have been using this to display news on my front page for along time now but I think its to slow. check it out
'Create DSN Less connection to Access Database
'Create DBConnection Object
Set DBConnection = Server.CreateObject("adodb.connection")
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; "
DSN = DSN & "DBQ=" & Server.Mappath("/databasename.mdb")
DBConnection.Open DSN
'Count the Records
SQLcount = "Select * From tblTopic Where Forum_ID = 25 and Priority >0"
Set RS = DBConnection.Execute(SQLcount)
Select Case RS.eof
Case False
tempRSCount = RS.getrows
Set RS = Nothing
count = Cdbl(UBound(tempRSCount, 2)) + 1
Case True
count = "0"
End Select
Set RS = Nothing
IF count > 0 Then
IF count > numpin Then
count = numpin
End IF
'Start listing news
while not count = 0
count = count - 1
SQL = "Select * From tblTopic Where Forum_ID =25 and Priority >0 ORDER BY Priority DESC"
Set RS = DBConnection.Execute(SQL)
rs.move idc
idc = idc + 1
title = rs("Subject")
date1 = rs("Start_Date")
topicnum = rs("Topic_ID")
'get reply_count
SQL = "Select * From tblThread Where Topic_ID = "& topicnum
Set RS = DBConnection.Execute(SQL)
Select Case RS.eof
Case False
tempRSCount = RS.getrows
Set RS = Nothing
replys = Cdbl(UBound(tempRSCount, 2)) + 1
Case True
replys = "0"
End Select
Set RS = Nothing
replys = replys - 1
'Get back to news
SQL2 = "Select * From tblThread Where Topic_ID = "& topicnum
Set RS = DBConnection.Execute(SQL2)
Author = rs("Author_ID")
content = rs("Message")
SQL3 = "Select * From tblAuthor Where Author_ID = "& Author
Set RS = DBConnection.Execute(SQL3)
user = rs("Username")
%>
This is where I put the HTML to display the page
<%
<%
rs.Movenext
wend
Else
End IF
%>
Dose anyone have any tips on this. I was thinking about using the forums database conection but I could use some tips on how I can get my code to do this.