Displaying Specific Records in a DB...

Results 1 to 2 of 2

Thread: Displaying Specific Records in a DB...

  1. #1
    MiCrOsLaVe Guest

    Default Displaying Specific Records in a DB...

    This may be achievable, or not, I don&#039t really know because I&#039ve just gotten into ASP. <BR><BR>What I&#039ve got is a page with a DSN connection to a database with 10 Rows + the AutoNumber.<BR><BR>I was usingthe Repeatregion function to display all 10 of them. (They are news posts, consiting of ID# / Body / Header / Date). But I want to change it so I can put some graphics in between them, and make it look more pretty.<BR><BR>What I want to be able to do is to layout the page, insert all the graphics, and formatting. Then be able to just reference every News header to a specifc ID#.<BR><BR>For example.<BR><BR>If I have a table with 3 columns, followed by a line of text, a scrolling marque and then 2 graphics, and then finally another table with 3 columns. Each colum within the table will be setup to look like a news post, with the first being equal to ID#1, Header1 ... Then the last table will be ID# 4,5,6. <BR><BR>I don&#039t want to include a query because it would look stupid, requiring someone to type 1,2,3,4,5,6 just to get the news lol. <BR><BR><BR>Is this possible? Or should i just go to text files? <BR><BR>Running an MS ACCESS 97 DB<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Displaying Specific Records in a DB...

    Just do something like this:<BR><BR>&#060;A HREF="showNews.asp?newsID=&#060;% = RS("theAutonumberField") %&#062;"&#062;<BR>&#060;% = RS("theNewsHeaderTitleOrWhatever") %&#062;<BR>&#060;/A&#062;<BR><BR>So when they click on the header, they get sent to the showNews.asp page.<BR><BR>On that page, you simply do<BR><BR>&#060;%<BR>id = Request("newsID")<BR>SQL = "SELECT * FROM table WHERE theAutonumberField = " & id<BR>...<BR>%&#062;<BR><BR>Or something along those lines.<BR><BR>Do *not* use ID# 1,2,3,4,5,6. Get the ID# from the autonumber field in the table. That way, no matter how many records you add or delete or change in the table, the HREF link will always reference the right one. Don&#039t display the ID# to the user either...why? what&#039s the point? He/she could care less that the internal ID#&#039s you are using happen to be 17,341,991,3211,6533,9897 instead of 1,2,3,4,5,6. Right?<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts