Newbie: Creating Blog-style Messageboard (Dreamweaver 8)

Reply

Join Date: Oct 2006
Posts: 3
Reputation: msniner is an unknown quantity at this point 
Solved Threads: 0
msniner msniner is offline Offline
Newbie Poster

Newbie: Creating Blog-style Messageboard (Dreamweaver 8)

 
0
  #1
Oct 3rd, 2006
Hello,

I am very new to ASP and have been taught by one of my colleagues that I could leverage Dreamweaver (i have version 8) to create ASPx pages that collaborate with Microsoft Access -- to implement a webpage that displays, as I would like to call it, news snippets -- this is relatively easy thing to do.

Now comes the problem of segregation: I need to start separating each individual news snippets. Why? Each news snippet will have a functionality where users can leave comments on that particular news snippet.

I believe blogs have this kind of functionality.

In my MS Access database, there are 2 tables. Here's the tables and their columns.
news_items
news_id (autonumber, primary key)
subject
title
by_who

user_comments
belonging_to_id (foreign key, value populated automatically as users submit comments via the front-end ASP page)
the_comment

When I look at Dreamweaver's generated code, it seems likely that I could start a dataset by writing a block of code (forgot how it looks like) with the corresponding SQL code injected inside this block of code.

I am trying to
1. Display the news snippets (think this part is ok for me)
2. Display the user's comments below each and every news snippet
3. Count the number of comments per news snippet

Should I use SQL and its "Count" and "Where" functionality to do #2 and #3? Or must I use VB?

Thanks for understanding. I come from client-end webpage programming background (JavaScript, DHTML and HTML) so I'm really interested in learning VB. Of course, Dreamweaver has to be part of the learning process
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 107
Reputation: madmital is an unknown quantity at this point 
Solved Threads: 3
madmital madmital is offline Offline
Junior Poster

Re: Newbie: Creating Blog-style Messageboard (Dreamweaver 8)

 
0
  #2
Oct 3rd, 2006
Originally Posted by msniner View Post
I am trying to
1. Display the news snippets (think this part is ok for me)
2. Display the user's comments below each and every news snippet
3. Count the number of comments per news snippet

Should I use SQL and its "Count" and "Where" functionality to do #2 and #3? Or must I use VB?

Thanks for understanding. I come from client-end webpage programming background (JavaScript, DHTML and HTML) so I'm really interested in learning VB. Of course, Dreamweaver has to be part of the learning process
I'd make the user select which news snippet to view by a link including the news_id value in it.
After that you just pull all the comments related to the snippet like
  1. "SELECT * FROM user_comments WHERE belonging_to_id =" & news_id
That'll get you the comments just for this snippet.
To count the number of comments you could either count as you loop through them, or make vb count the number of rows in the recordset.

  1. While Not recordset.EOF
  2. counter = counter + 1
  3. recordset.MoveNext
  4. Wend
  5.  
  6. ' OR
  7.  
  8. counter = recordset.RecordCount
  9.  
  10. ' OR
  11. ' read the sql results into an array and get the upper bounds
  12.  
  13. RS.Open "SELECT * FROM user_comments WHERE belonging_to_id =" & news_id, connectionObject
  14. comsArray = RS.GetRows()
  15. counter = UBound(comsArray)-1
  16. for i = 0 to ubound(comsArray)-1
  17. response.write comsArray(1) 'write out the comment
  18. Next

The recordCount method will return "-1" unless you use the correct CursorType.
Last edited by madmital; Oct 3rd, 2006 at 12:14 pm.
Web Developer
When something seems too good to be true...it usually is
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ASP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC