hi,
I have a multithreaded discussion board and what I want to do is count up the TOTAL number of replies to a topic.
The board is multilevel, so people can reply to replies of replies.
I'm using ASP to connect to an Access database.
At the moment I'm getting the count like this :
getReplies(ID)
get all replies to ID
loop through replies
for each reply, call getReplies with ID of reply
increment replyCount
end loop
end get replies
Now this means opening a new recordset for each level. So if a topic is bounced between two people, say for 20 posts, that's 20 recordsets opened, each with a count of 1.
To do this for for every post, when there's 20 posts on a page must surely be pretty demanding of resources.
I've seen SQL that will get a count of replies to a message, but what I want is not only replies to the parent message, but replies to the replies, replies to the replies of the replies and so on.
Any ideas ???
I have a multithreaded discussion board and what I want to do is count up the TOTAL number of replies to a topic.
The board is multilevel, so people can reply to replies of replies.
I'm using ASP to connect to an Access database.
At the moment I'm getting the count like this :
getReplies(ID)
get all replies to ID
loop through replies
for each reply, call getReplies with ID of reply
increment replyCount
end loop
end get replies
Now this means opening a new recordset for each level. So if a topic is bounced between two people, say for 20 posts, that's 20 recordsets opened, each with a count of 1.
To do this for for every post, when there's 20 posts on a page must surely be pretty demanding of resources.
I've seen SQL that will get a count of replies to a message, but what I want is not only replies to the parent message, but replies to the replies, replies to the replies of the replies and so on.
Any ideas ???