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)
%>
the elite schedule of the stars of the Galaxy <%= strtitle%>
My schedule
<%= strtitle%>
<%
' Create a database connection.
End Sub
' Invokes the Connection object execute method, passing in the text string of the command you want to execute, and loops in it once you have a recordset.
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
--Set up the SQL Server side. Simply save a text string that indicates the nature of the event (up to 100 characters long).
--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
Note : More wonderful tutorials please focus on the triple Design Tutorials section,