943,640 Members | Top Members by Rank

Ad:
  • ASP Discussion Thread
  • Unsolved
  • Views: 5099
  • ASP RSS
Oct 3rd, 2006
0

Newbie: Creating Blog-style Messageboard (Dreamweaver 8)

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
msniner is offline Offline
3 posts
since Oct 2006
Oct 3rd, 2006
0

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

Click to Expand / Collapse  Quote originally posted by msniner ...
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
ASP Syntax (Toggle Plain Text)
  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.

ASP Syntax (Toggle Plain Text)
  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.
Reputation Points: 10
Solved Threads: 5
Junior Poster
madmital is offline Offline
119 posts
since Jun 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP Forum Timeline: asp with vbscript and javascript
Next Thread in ASP Forum Timeline: Microsoft OLE DB Provider for ODBC Drivers error '80040e14'





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC