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]