Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Today in History Script.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Today in History Script.

 Post Reply Post Reply Page  <1 2345>
Author
davidshq View Drop Down
Senior Member
Senior Member


Joined: 29 July 2003
Location: United States
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote davidshq Quote  Post ReplyReply Direct Link To This Post Posted: 26 October 2003 at 8:58pm
dpyers,
   Thanks for the comments...I'll try and implement some of your recommendations...However let me also make reply to your first of your last points:
(1)I didn't put the entire date into the same field as I didn't want to have to write code to parse the date and separate out month/day from the year, etc. Adding separate fields for month, day allowed me to simply search and display on that basis.
Respectfully,
David Mackey.
Back to Top
davidshq View Drop Down
Senior Member
Senior Member


Joined: 29 July 2003
Location: United States
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote davidshq Quote  Post ReplyReply Direct Link To This Post Posted: 27 October 2003 at 9:03am

Hi Guys,
   Okay...I've been getting some suggestions and all but here I think is the next step in the process and I could use some help in programming it:
   The add events page is going to be designed with frames. The top frame will display the last ten entries in the database (this is because sometimes events span several days - e.g. the Battle of Gettysburg - and it will be easier to remember which day you are on if you can see the last ten), the middle will have the form where you will enter the new event and the bottom frame will allow you to search for a certain date or event. The middle and the bottom should be no problem...but how to get the top frame to display the last ten database entries I have not been able to figure out.
   Each event does have an ID_no so I need some sort of code that will find the last ID_no then show the next ten before that and also not throw an error if an ID_no is missing (e.g. 999, 997, 995, 993) because users will delete events and ID_no's will not necessarily be consecutive.
   If I can get this information maybe I can have the add events page finished by the end of today...Next on my list to do then is to complete the edit/update page which is also currently in progress (30% complete).
   Thanks.
Respectfully,
David Mackey.

Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 27 October 2003 at 11:23am
If you want to just display the last ten events you can use a simple search query ordering it descending so i.e.
select top 10 * from yourtable order by ID_no DESC
If the user has the capability to browse to the previous ten, you would need to implement paging.
You can check this link which is a Quote of the day script and uses paging. There are also a bunch of tutorials on aspin.com just enter the keyword paging.
Back to Top
davidshq View Drop Down
Senior Member
Senior Member


Joined: 29 July 2003
Location: United States
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote davidshq Quote  Post ReplyReply Direct Link To This Post Posted: 27 October 2003 at 12:54pm

Okay...I've added a few more features however I have to run off to class in just a minute...So I'll tell you about them now and then update the zip and may even get a working demo going after class (hopefully).

- Added a main page to add events which is broken up into three frames. The first allows you to see the last ten entered events, the second allows you to add an event, and the third allows you to search for events.

Well...I guess that isn't all that much...but it does consist of around five separate pages of coding...
Respectfully,

David Mackey

- www.civilwarsearch.com

Back to Top
davidshq View Drop Down
Senior Member
Senior Member


Joined: 29 July 2003
Location: United States
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote davidshq Quote  Post ReplyReply Direct Link To This Post Posted: 27 October 2003 at 4:15pm

Okay, I've got one last bug to clear out...can anyone see what is wrong w/the coding on this page? I'm at my wits end:

<%

Dim adoConn

Dim rsToday

Dim strSQL

Dim parsedID

parsedID = CLng(Request.Form("ID"))

Set adoConn = Server.CreateObject("ADODB.Connection")

adoConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("civilwar.mdb")

Set rsToday = Server.CreateObject("ADODB.Recordset")

strSQL = "SELECT * FROM tblToday WHERE ID=" & parsedID

rsToday.CursorType = 2

rsToday.LockType = 3

rsToday.Open strSQL, adoConn

rsToday.Fields("ID")=Request.Form("ID")

rsToday.Fields("mMonth")=Request.Form("mMonth")

rsToday.Fields("mDay")=Request.Form("mDay")

rsToday.Fields("mYear")=Request.Form("mYear")

rsToday.Fields("mEvent")=Request.Form("mEvent")

rsToday.Update

rsToday.Close

Set rsToday = Nothing

Set adoConn = Nothing

Response.Redirect "addtdih.asp"

%>

Respectfully,
David.

- www.civilwarsearch.com

Back to Top
KCWebMonkey View Drop Down
Senior Member
Senior Member
Avatar
Go Chiefs!

Joined: 21 June 2002
Status: Offline
Points: 1319
Post Options Post Options   Thanks (0) Thanks(0)   Quote KCWebMonkey Quote  Post ReplyReply Direct Link To This Post Posted: 27 October 2003 at 4:26pm
rsToday.Fields("ID")=Request.Form("ID")

should be

rsToday.Fields("ID") = parsedID
Back to Top
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post Posted: 27 October 2003 at 5:29pm
rsToday.Fields("ID")=Request.Form("ID") should be taken off. You don't update the ID (autonumber) field.

Edited by fernan82
FeRnAN
Back to Top
KCWebMonkey View Drop Down
Senior Member
Senior Member
Avatar
Go Chiefs!

Joined: 21 June 2002
Status: Offline
Points: 1319
Post Options Post Options   Thanks (0) Thanks(0)   Quote KCWebMonkey Quote  Post ReplyReply Direct Link To This Post Posted: 27 October 2003 at 8:16pm
oops.... well either way it needed to be changed.. 
Back to Top
 Post Reply Post Reply Page  <1 2345>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.