ASP Inline Corporate Calendar Documentation
By: Aaron B. http://www.aaronoutpost.com
Copyright© 2003-2005 _-Squire-_ Creations All Rights Reserved.

Back to Main

Adding Mini Calendar To Existing Website


  1. If you wish to add the mini calendar into your homepage or another page on your site, place the Calendar directory containing the main files as a sub directory of the page you wish to integrate the mini calendar into.

    Example: e:home/yourwebsite/htdocs/Calendar/

    You calendar needs to be in a subfolder in respect to your homepage.

  2. The page you want to place the mini calendar in must have the extension .asp.

     

  3. Open inc_mini_calendar.asp and add the following two lines to the top of the code:

    <!--#include file="inc_ADO.asp" -->
    <!--#include file="inc_common.asp" -->

    These are include files that are needed when only mini calendar is ran. While running under the calendar these data in these files is already loaded for the mini calendar and were removed do to redundancy and to increase performance. That is why you must re-add those two lines.

    If you wish, you can save inc_mini_calendar.asp as a new file and point to that file to reduce the script from loading the same code twice. If you are experiencing performance issues it is recommended that you do that.
     
  4. Place the following lines in the place on the page where you wish the mini calendar to be displayed:

    How to include Mini Calendar into Website:

    You will notice the mini-calendar on the left hand side of the original Calendar. This mini calendar must be included in order for the events calendar to work. So, to include this file, this is all your need to put in your source.

    <!--#include file="inc_mini_calendar.asp" -->

    Which if your site uses multiple folders then you may want to use virtual so no matter what page you are browsing it is pointed to the correct file.

    Example: <!--#include virtual="calendar/inc_mini_calendar.asp" -->

    For ASP 3 (Win2k/Win2003 Servers): -

    <% Server.Execute"
    inc_mini_calendar.asp" %>

  5. You will also need to include the style page into your website. The style information needs to be included in the head of the website.

    <!--#include file="inc_style_script.asp" -->

  6. If you are using the mini calendar on your website and it uses multiple directories then the database connection in inc_common.asp file needs to be set to the physical directory of the file.

    How to switch which driver to use
    The Apostrophe Mark declares a comment. You will notice only one Connection driver below does not have an Apostrophe Mark before it. It is the Driver that is being used. Place an Apostrophe Mark before it to and take it away for the driver that you wish to use.

    Below you will notice the connection that is used by default. This is for a OLEDB Jet 4.0 Access 2000/2002 connection which is used by most servers. The first strConnCal does not contain an apostrophe mark in front of it. It is the one in use. The second uses the same connection but allows you to enter the physical address of the calendar database.

    You need to use the second option to use the mini calendar in a multiple folder website. So no matter what subdirectory you are on the website, it will always point to the database file. If you are unsure what the physical address is, while connected to the server via ftp or similar, look at the location of the files or contact your server administrator if you cannot get a valid connection.

    'For Access 2000/2002
    strConnCal = "Provider=Microsoft.Jet.OLEDB.4.0; JET OLEDB:database; Data Source=" & Server.MapPath("admin/calendar.mdb")

    'strConnCal = "Provider=Microsoft.Jet.OLEDB.4.0; JET OLEDB:database; Data Source=C:\inetpub\wwwroot\Calendar\admin\calendar.mdb"