Chunfeng. asp
'This page shows what has been arranged,And the link at the bottom can be turned around by month.
'This Code contains the functions used to obtain data connections.,If the data source changes,The connection information needs to be edited at only one location.(Servers, users, and passwords).
<@ 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> <H1> My schedule </H1>
<H3> <% = Strtitle %> </H3>
<%
'Create a database connection.
End sub
'CallConnectionObjectExecuteMethod,Input the text string of the command to be executed,Once a record set is available,Loop 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 a result,UseSetCommand to send a new connection.
Set GetDataConnection = oConn
End function
%>
Calendar. SQL
--CreateSQLServer.You only need to save a text string indicating the event nature(The maximum value is100Characters)You can..
--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]