This article describes how to create a Web-based calendar and how to create a Web site for developers who are not familiar with Active Server Pages (ASP), SQL, and ADO, it also provides experienced developers with Web site scalability skills.
With the development of network applications, Web-based calendars are becoming more and more important. For important events such as the deadline or schedule, or who is on vacation, web-based calendars are useful. This article describes how to use ASP in IIS and SQL Server to create a simple Web-based calendar and allow you to share your calendar with others or manage the calendar of a group of people.
Create an SQL Server
For a Web calendar, you only need to save a text string indicating the event nature on the server side. The string can contain a maximum of 100 characters. The source code is as follows:
Calendar. SQL
-- Create a table
Create table Schedule
(
IdSchedule smallint identity primary key,
DtDate smalldatetime not null,
VcEvent varchar (100) not null
)
Go
-- Stored Procedure
Create procedure GetSchedule (@ nMonth tinyint, @ nYear smallint)
As
Select idSchedule, convert (varchar, datepart (dd, dtDate) 'nday', vcEvent
From Schedule
Where datepart (yy, dtDate) = @ nYear and datepart (mm, dtDate) = @ nMonth
Order by datepart (dd, dtDate)
Go
Create procedure AddEvent (@ vcDate varchar (20), @ vcEvent varchar (100 ))
As
Insert Schedule
Select @ vcDate, @ vcEvent
Go
Create procedure DeleteEvent (@ idSchedule smallint)
As
Delete Schedule where idSchedule = @ idSchedule
Go |