Chunfeng.asp
' the page can see what has been arranged , and the links at the bottom can be flipped around the moon .
' This code contains functions that get data connections , and if the data source changes , only one location needs to edit the connection information ( server, user, and password ).
<@ language= "VBscript"
EnableSessionState = False %>
<%
' the table header includes 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"The elite schedule of the stars of the Galaxy%= strtitle%>< /title
/head>
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
' invoke the Connection Object Execute method to pass in the text string of the command you want to execute, and once you have a recordset, you can loop through the .
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 , the new connection is outgoing using the Set command .
Set getdataconnection = oconn
End Function
%>
Calendar.sql
-- Establish SQL server side . Simply save a text string that indicates the nature of the event (up to a maximum of two characters ) .
-- Create a table
CREATE TABLE Schedule
(
Idschedule smallint Identity Primary key,
Dtdate smalldatetime NOT NULL,
Vcevent varchar (MB) NOT NULL
)
Go
-- stored procedures
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), @vcEvent varchar (100))
As
Insert Schedule
Select @vcDate, @vcEvent
Go
CREATE PROCEDURE deleteevent (@idSchedule smallint)
As
Delete Schedule where idschedule = @idSchedule
Go
[1]