473,395 Members | 2,079 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Help needed with databases + asp problem

Hi,

I'm new to databases & asp and am using dreamweaver mx 2004 (trial) to go about
making dynamic pages. I was wondering if anyone could help me with a problem
that I'm having, I would think its pretty easy to solve...

Basically what I want to do is to have webpage showing the top news stories of
the day with a limit of 3 database (ie news) entries per page. Obviously the
top stories will change day by day and I will be adding them to the database
via an asp form. This part is no problem. Where my problem arises is that if
I limit the repeat region asp command to 3 entries on the page, then the page
will only display the first 3 entries in the database and not the new entries
that I add. What I want to do is to replace the oldest news story (ie the
first in the database) with the newest (ie the last added to the database) and
show the newer news story on the webpage with the oldest entry being "bumped"
so to speak. However, I would like to keep the older news stories in the
database, just not have them on the website.

Does anyone know how I would go about this in dreamweaver or access? I would
have thought it would be as simple as to just sort them descending rather than
ascending but can't quite work out how to do this!!!

Any help would be greatly appreciated! :)

Rob F.
Nov 13 '05 #1
5 1074
Rob,

Why don't you just add a yes/no field to your news table called
FrontPage or something. Check it by default, then uncheck it for the
old(er) articles you don't want to display. Does the process have to be
automated?

Rob Forey -- The Man With No Nails wrote:
Hi,

I'm new to databases & asp and am using dreamweaver mx 2004 (trial) to go about
making dynamic pages. I was wondering if anyone could help me with a problem
that I'm having, I would think its pretty easy to solve...

Basically what I want to do is to have webpage showing the top news stories of
the day with a limit of 3 database (ie news) entries per page. Obviously the
top stories will change day by day and I will be adding them to the database
via an asp form. This part is no problem. Where my problem arises is that if
I limit the repeat region asp command to 3 entries on the page, then the page
will only display the first 3 entries in the database and not the new entries
that I add. What I want to do is to replace the oldest news story (ie the
first in the database) with the newest (ie the last added to the database) and
show the newer news story on the webpage with the oldest entry being "bumped"
so to speak. However, I would like to keep the older news stories in the
database, just not have them on the website.

Does anyone know how I would go about this in dreamweaver or access? I would
have thought it would be as simple as to just sort them descending rather than
ascending but can't quite work out how to do this!!!

Any help would be greatly appreciated! :)

Rob F.


--
--------------------------------------
Chris Moore
cdmwebs [at] no_spam_hotmail [dot] com
http://cdmwebs.com
Nov 13 '05 #2
>Why don't you just add a yes/no field to your news table called
FrontPage or something. Check it by default, then uncheck it for the
old(er) articles you don't want to display. Does the process have to be
automated?


Hi, thanks for the quick response! Unfortunately it does have to be automated
and I'm too new to asp to trust myself with even the simplest of if/then
commands. :)

I think the problem would be solved if, when adding new records to the
database, the new record became autonumber 1 and the previous record 1 became
autonumber 2, etc rather than how it normally works, with new records taking on
the next available number. Does anyone happen to know how to do this in
access? It sounds pretty like it should be pretty simple to me, although I'm
not sure I've explained myself very well! :)

Rob F.
Nov 13 '05 #3
How about an inserted date/time field? Grab the top 3 sorted by insert
date/time descending? I assume you're using sql from your asp page to
grab the records from an ms access db?

Rob Forey -- The Man With No Nails wrote:
Why don't you just add a yes/no field to your news table called
FrontPage or something. Check it by default, then uncheck it for the
old(er) articles you don't want to display. Does the process have to be
automated?

Hi, thanks for the quick response! Unfortunately it does have to be automated
and I'm too new to asp to trust myself with even the simplest of if/then
commands. :)

I think the problem would be solved if, when adding new records to the
database, the new record became autonumber 1 and the previous record 1 became
autonumber 2, etc rather than how it normally works, with new records taking on
the next available number. Does anyone happen to know how to do this in
access? It sounds pretty like it should be pretty simple to me, although I'm
not sure I've explained myself very well! :)

Rob F.


--
--------------------------------------
Chris Moore
cdmwebs [at] no_spam_hotmail [dot] com
http://cdmwebs.com
Nov 13 '05 #4
>How about an inserted date/time field? Grab the top 3 sorted by insert
date/time descending? I assume you're using sql from your asp page to
grab the records from an ms access db?


That was an excellent idea Chris, and I was halfway through implementing it
before I found a sort feature within dreamweaver which can sort records
backwards. Turns out I was looking for an access solution when the solution
was in fact in dreamweaver :) Thank you very much for your help though, the
date/time idea was a very clever solution. :)

Rob F.
Nov 13 '05 #5
TOP 3 would indeed be good to put in the SQL statement but also criteria to
limit the records shown to be that of the current date.

strSQL = "SELECT TOP 3 * FROM MyTable WHERE MyDate = #" & Date() & "#"

Best regards,
J. Paul Schmidt, Freelance Access and ASP Web Developer
www.Bullschmidt.com
Classic ASP Design Tips, ASP Web Database Demo, ASP Bar Chart Tool...
Nov 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ralph Freshour | last post by:
I'm not sure the follow multiple table query is the right way to do what I need to do although it seems to be working: $php_SQL = "SELECT * ". "FROM basics, personal, photos ". "WHERE...
19
by: Thue Tuxen Sørensen | last post by:
Hi everybody ! I´m maintaining a large intranet (approx 10000 concurrent users) running on one IIS box and one DB box with sqlserver 2000. Currently there is 2,5 GB Ram, 1 1400 mhz cpu and 2...
3
by: Stephen | last post by:
I have to write a .Net application which can compare SQL Databases including things like: - DB structure, PK's, FK's, indexes and types of indexes i.e. should be able to detect if the same index...
3
by: Tom Williams | last post by:
Hi! Ok, in this thread: ...
0
by: Don Sealer | last post by:
I've been getting a message that says the network connection can't be found. What does that mean? Here's what I've been doing. Over the course of time I've developed about 8 or 10 fairly simple...
15
by: DavidS | last post by:
Have Visual Studio.NET installed on MS 2000 Professional OS laptop. No issue ever with web development and SQL connections. Purchased new laptop with XP Professional SP2!!!!!!!! & Visual...
5
by: Anns via AccessMonster.com | last post by:
My establishment has about 20 ms access db's that will be converted over (see subject). When we pull all the BE's over to SQL and the FE's on Sharepoint (.net) surely we don't have to change...
13
by: Jennifer.Berube | last post by:
well I'm not sure how to go about making my SQL connection string... The code below is what I need to replace with my SQL connection...I just don't know if that code is for DSN or access... I...
1
by: rfranzl | last post by:
Hello, I need some help, I have about 200 databases that are copies of an original database that has a similiar table in all of the databases, called "tblCodebook". What I am trying to do is to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.