Select all rows of data and compare values
Hello, I'm trying to modify some code to select all rows of records in a access database table. I am seeing only the first record.
Here is the code:
I am only seeing the value of the first record. Never any more. What am I doing wrong?
Thanks in advance for your help.
??? You don't show any *LOOP* on the recordset, so of course you will only see one record.
You are using NightmarishStalker code (AKA the misnamed DreamWeaver) but apparently you have modified it. As bad as DrunkWalker code normally is, it would do the loop for you.
But you also say "The above code is repeated using different variables through out the page" and that tells me that your code is horribly inefficient.
Maybe if you showed some sample data from the DB table and some sample output you are trying to achieve we could toss out the DoofusWhacker code and give you something usable.
Hi Old Pedant,
I am all for getting rid of the DrunkWalker code.
What I want to do is simply loop through the database table and those recordsets that have Com_Live = True and then use the value of Article_ID which is a text field to show whether there is a comment been posted to that article or not.
Something like this around each story in the newsletter, minus the code,
if the value of Article_ID = "10-1" than response.write("Read/Write Comments")
ElseIf the value of Article_ID <> "10-1" than response.write("Write a Comment")
Here is a link to the page I am working on
Thanks for your suggestions and help
Can you show me a dump of the table? Just show me 3 or 4 records from the table would be enough. And for the text field that holds the actual comment it's okay to chop it off to just a few characters.
Are the articles coming from a DB table, as well? If so what is the structure of that table? That is, what are the field names and types?
Old Pedant, Sent you a screen capture of the database table via private message. Is that enough or do you need more?
I replied to you in PM. Did you not get the reply?
Here...a copy of that message:
The articles are not in a database. They are entered in html in the pages' three columns. I manually assign article ID values to each one sequentially - center column, left side column, right side column. The manually coded article ID is then part of the link passed to the comments.asp. Example: comments.asp?Article_ID=10-10&Article_MoYr=Oct2012&Article_title=The Magic of Music"
Basically all I am trying to do in alert the reader of the article if comments have been made and approved or not based on whether or not a comment corresponding to that article exists in the comments db table.
Hope this helps
|All times are GMT +1. The time now is 07:58 AM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.