How to create a Web calendar table?

Source: Internet
Author: User

Chunfeng. asp

'The page shows what has been arranged and the link at the bottom can be turned around by month.

'The Code contains the function for getting data connections. If the data source changes, you only need to edit the connection information (server, user, and password) in one location ).

<@ LANGUAGE = "VBscript"

ENABLESESSIONSTATE = False %>

<%

'The header contains the files used to start all pages, including global functions.

Option Explicit

Response. Buffer = True

Response. Expires = 0

Sub Dochunfeng (strtitle)

%>

<Html>

<Head>

<META HTTP-EQUIV = "Content-Type" CONTENT = "text/html; charset = gb2312">

<Title> galaxy video's elite schedule <% = strtitle %> </title>

</Head>

<Body bgcolor = "white" link = "blue" alink = "blue" vlink = "blue">

<Basefont face = "Verdana, Arial">

<Center>

<H3> <% = strtitle %>

<%

'Create a database connection.

End sub

'Call the Execute method of the Connection object and pass in the text string of the command to be executed. Once a record set is available, it can be cycled in it.

Function GetDataConnection ()

Dim oConn, strConn

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

StrConn = "Provider = SQLOLEDB; Data Source = adspm; Initial Catalog = TeamWeb ;"

StrConn = strConn & "User Id = TeamWeb; Password = x"

OConn. Open strConn

'As the result, use the set command to output a new connection.

Set GetDataConnection = oConn

End function

%>

Calendar. SQL

-- Create an SQL Server. You only need to save a text string (up to 100 characters) indicating the event nature.

-- 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

[1]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.