Today in History Script.
Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: General Discussion
Forum Description: General discussion and chat on any topic.
URL: https://forums.webwiz.net/forum_posts.asp?TID=6664
Printed Date: 30 March 2026 at 4:42am Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com
Topic: Today in History Script.
Posted By: davidshq
Subject: Today in History Script.
Date Posted: 23 October 2003 at 3:42pm
|
Hi Folks, I was wondering if anyone knew of a Today in History ASP script that was free?
Respectfully, David Mackey - www.civilwarsearch.com
|
Replies:
Posted By: michael
Date Posted: 23 October 2003 at 5:05pm
The script is not the problem, the problem woulf be having the database behind it...
------------- http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker
|
Posted By: davidshq
Date Posted: 23 October 2003 at 8:24pm
|
Michael, Can you explain why the database would be a problem? Or do you mean the fact that you would need to fill it with facts? I am working on design a TiH script now.
Respectfully, David Mackey. - www.civilwarsearch.com
|
Posted By: davidshq
Date Posted: 23 October 2003 at 8:58pm
|
Hi Folks, Check out what I have completed so far at http://www.dhq.nu/tdih/todayinhistory.asp - www.dhq.nu/tdih/todayinhistory.asp . Here is the source:
' David Mackey's Today in History ASP Script.
<%
' Variables.
Dim adoConn
Dim rsToday
Dim strSQL
Set adoConn = Server.CreateObject("ADODB.Connection")
adoConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("civilwar.mdb")
strSQL="SELECT tblToday.Year, tblToday.Event Where tblToday.Month = month(date) and tblToday.Day = day(date)"
rsToday.Open strSQL, adoConn
Do While Not rsToday.EOF
Response.Write(rsToday("Month"))
Response.Write(rsToday("Day"))
Response.Write(rsToday("Year"))
Response.Write(rsToday("Event"))
rsToday.MoveNext
Loop
rsToday.Close
Set rsToday = Nothing
Set adoConn = Nothing
%>
Of course it doesn't work...Any help would be appreciated. :-)
Respectfully,
David.
|
Posted By: dpyers
Date Posted: 24 October 2003 at 12:22am
|
' David Mackey's Today in History ASP Script.
Microsoft VBScript runtime error '800a01a8'
Object required: ''
/tdih/todayinhistory.asp, line 12
-------------
Lead me not into temptation... I know the short cut, follow me.
|
Posted By: WebWiz-Bruce
Date Posted: 24 October 2003 at 1:51am
Which line is line 12???
------------- https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting
|
Posted By: davidshq
Date Posted: 24 October 2003 at 6:18am
|
Line 12 is
rsToday.Open strSQL, adoConn
I believe. It probably has to do with my SQL statement. Respectfully, David Mackey.
- www.civilwarsearch.com
|
Posted By: davidshq
Date Posted: 24 October 2003 at 6:25am
Here is the newest code I have written: (Still not functioning)
<% ' Variables. Dim adoConn Dim rsToday Dim strSQL
Set adoConn = Server.CreateObject("ADODB.Connection") adoConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("civilwar.mdb") strSQL="SELECT tblToday.mYear, tblToday.mEvent, tblToday.mMonth, tblToday.mDay Where tblToday.mMonth =" & month(date) & "tblToday.mDay =" & day(date)
rsToday.Open strSQL, adoConn Do While Not rsToday.EOF Response.Write(rsToday("mMonth")) Response.Write(rsToday("mDay")) Response.Write(rsToday("mYear")) Response.Write(rsToday("mEvent")) rsToday.MoveNext
Loop
rsToday.Close Set rsToday = Nothing Set adoConn = Nothing
%> Respectfully, David Mackey.
|
Posted By: KCWebMonkey
Date Posted: 24 October 2003 at 6:45am
|
is the database in the same folder as the script? cause the server.mappath is saying that it is...
Server.MapPath("civilwar.mdb") |
|
Posted By: davidshq
Date Posted: 24 October 2003 at 6:55am
|
Yes, the database is in the same path.
- D. Mackey. - www.civilwarsearch.com
|
Posted By: KCWebMonkey
Date Posted: 24 October 2003 at 7:44am
|
you don't have the recordset object
<% ' Variables. Dim adoConn Dim rsToday Dim strSQL
Set adoConn = Server.CreateObject("ADODB.Connection") Set rsToday = Server.CreateObject("ADODB.Recordset") adoConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("civilwar.mdb") strSQL="SELECT tblToday.mYear, tblToday.mEvent, tblToday.mMonth, tblToday.mDay Where tblToday.mMonth =" & month(date) & "tblToday.mDay =" & day(date)
rsToday.Open strSQL, adoConn Do While Not rsToday.EOF Response.Write(rsToday("mMonth")) Response.Write(rsToday("mDay")) Response.Write(rsToday("mYear")) Response.Write(rsToday("mEvent")) rsToday.MoveNext
Loop
rsToday.Close Set rsToday = Nothing Set adoConn = Nothing
%>
|
|
Posted By: davidshq
Date Posted: 24 October 2003 at 9:50am
|
Okay...I've updated the script again but now I'm getting the following error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'mMonth =10mDay =24'.
/tdih/todayinhistory.asp, line 13
Respectfully,
David.
|
Posted By: davidshq
Date Posted: 24 October 2003 at 9:55am
Posted By: davidshq
Date Posted: 24 October 2003 at 12:38pm
|
Okay....I've created a page for any scripts I create in the future and the current TDiH script. I'd appreciate any ideas you may have that aren't already mentioned on the To-Do list. For anyone who is interested you can check out the pages and download the script at: http://www.dhq.nu/scripts/ - http://www.dhq.nu/scripts/ The script was written in Win32Pad while the database was created using Web Matrix. Respectfully, David Mackey.
- www.civilwarsearch.com
|
Posted By: dpyers
Date Posted: 24 October 2003 at 2:00pm
http://www.dhq.nu/scripts/ - http://www.dhq.nu/scripts/ =
Directory Listing DeniedThis Virtual Directory does not allow contents to be listed.
-------------
Lead me not into temptation... I know the short cut, follow me.
|
Posted By: davidshq
Date Posted: 24 October 2003 at 9:52pm
|
Sorry about that - my server was working weird but if you go to http://www.dhq.nu/scripts/ - www.dhq.nu/scripts/ it should work now. :-) Also, I've added a web-based interface to add database entries and I will update the version soon (currently without this feature it is .2 then it will be .3).
Respectfully, David Mackey.
|
Posted By: KCWebMonkey
Date Posted: 25 October 2003 at 11:07am
Directory Listing Denied
This Virtual Directory does not allow contents to be listed.
|
Posted By: davidshq
Date Posted: 25 October 2003 at 11:47am
|
Sorry, I know, I know. :-/ Its a problem with my server, firewall, or something...I'm working on fixing it. :-P The pages really are there...
Respectfully, David Mackey
- www.civilwarsearch.com
|
Posted By: ebonyking
Date Posted: 25 October 2003 at 11:54am
|
Please Help Me!

Can any one of you fine men help me to setup my website for my man EbonyKing?
|
Posted By: davidshq
Date Posted: 25 October 2003 at 12:00pm
|
ebonyking I don't understand what you are looking for?
Respectfully, David Mackey.
|
Posted By: dpyers
Date Posted: 25 October 2003 at 3:28pm
If this isn't related to the problem under discussion, you should start a new thread. More info will be needed though.
-------------
Lead me not into temptation... I know the short cut, follow me.
|
Posted By: davidshq
Date Posted: 25 October 2003 at 6:48pm
|
   Okay...finally....Its up...But its at a new URL:
http://www.dhq.nu/dmscripts/ - http://www.dhq.nu/dmscripts/ What was wrong? scripts is a reserved directory on my server's hosts. :-P Respectfully, David Mackey
- http://www.c - www.c ivilwarsearch.com
|
Posted By: dpyers
Date Posted: 25 October 2003 at 10:48pm
|
Couple of things...
You should always start each asp script with Option Explicit. This forces you to declare (dim) each variable before using it. If you had done so, you would have tossed an error on your If mMonth = statements as they way you're using mMonth there assumes it is a variable, not something from the record set. When I run the script, I get nothing where the month name should be. You need to change the If mMonth = statements to If rsToday("mMonth") =
You can also change the whole group of if statements to a Select Case statement which runs much faster.
One quibbly thing... the separator between displayed day and year shoulf be ", " instead of " ,"
-------------
Lead me not into temptation... I know the short cut, follow me.
|
Posted By: dpyers
Date Posted: 26 October 2003 at 4:57pm
|
Couple of follow-up points...
- Really no need to have separate fields for year, month, day. Most people would use just a single date field.
- Be aware that the client pc viewing your pages could be on the other side of the world from your server. Your current date could well be different from theirs. Personally, I wouldn't worry about it, but you may get some emails. Time Zone Offsets like that used for this forum are really only suitable for registered users, not casual viewers. If you pick up a current date passed from the user, different country codes will affect the date format.
-------------
Lead me not into temptation... I know the short cut, follow me.
|
Posted By: davidshq
Date 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.
|
Posted By: davidshq
Date 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.
|
Posted By: michael
Date 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 http://www.planet-source-code.com/vb/scripts/ShowCode.asp?lngWId=4&txtCodeId=7484 - 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.
------------- http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker
|
Posted By: davidshq
Date 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
|
Posted By: davidshq
Date 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
|
Posted By: KCWebMonkey
Date Posted: 27 October 2003 at 4:26pm
rsToday.Fields("ID")=Request.Form("ID")
should be
rsToday.Fields("ID") = parsedID
|
Posted By: fernan82
Date 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.
------------- FeRnAN
http://www.danasoft.com/">
|
Posted By: KCWebMonkey
Date Posted: 27 October 2003 at 8:16pm
oops.... well either way it needed to be changed..
|
Posted By: davidshq
Date Posted: 28 October 2003 at 8:44am
|
:-) Version 1 is now officially released. Whereas the version .20 only displayed events already present in a database the new version includes the following: - Web-Based Admin. - Add New Events. - Edit Events. - Delete Events. Probably my favorite new feature (okay, okay, its my script, I know)...is the way it can (when adding new events) search for a given entry and also displays the ten most recently created entries. Welll, you can get the new version at http://www.dhq.nu/dmscripts/ - www.dhq.nu/dmscripts/ . I've also updated the "To Do" list of things - if you have any other recommendations feel free to send them. Or...if anyone is interested in actually writing a portion of the script let me know too. :-) Respectfully, David Mackey.
- http://www.civilwarsearch.com - www.civilwarsearch.com
|
Posted By: davidshq
Date Posted: 28 October 2003 at 2:35pm
|
I've just fixed a small glitch in the script that caused the main add event page to have some problems...I'll try and upload it soon...However before I do so it'd be nice to fix another problem I'm having. As you may (or may not be) aware the page is divided into three frames. The top frame displays the last ten results, the middle has the add item form, the last has a search form. Now, the problem is that I need the top frame to update every time a user adds a new item. Any ideas?
Respectfully, David Mackey.
www.civilwarsearch.com
|
Posted By: Diep-Vriezer
Date Posted: 28 October 2003 at 3:37pm
Just refresh at a regular rate, like 2 sec.
------------- Gone..
|
Posted By: Diep-Vriezer
Date Posted: 28 October 2003 at 3:38pm
|
Doing this in an iframe is better.
------------- Gone..
|
|