SoFunction
Updated on 2025-04-08

How to make a web schedule?

' This page shows what has been arranged,And at the bottom link can be flipped around month by month.

' This code contains functions to get data connection,If the data source changes,There is only one location that needs to edit the connection information(Server, user and password).

  <@ LANGUAGE="VBscript"

  ENABLESESSIONSTATE = False %>

  <%

  ' The header includes files used to start all pages,Include global functions.

  Option Explicit

  = True

  = 0

  sub Dochunfeng(strtitle)

  %>

  html

  head

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

  title>The Elite Schedule of Galaxy Shadow Movement<%= 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

' CallConnection Object Execute method,Pass the text string of the command you want to execute into,Once there is a record set,You can loop in it.

  function GetDataConnection()

  dim oConn, strConn

  Set oConn = ("")

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

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

  strConn

  ' As a result,usesetCommand out of new connection.

  set GetDataConnection = oConn

  end function

  %>

 

-- EstablishSQLServer side.Just save a text string indicating the nature of the event(The longest is100Characters)Just.

 

-- Create a table

  create table Schedule

  (

  idSchedule smallint identity primary key,

  dtDate smalldatetime not null,

  vcEvent varchar(100) 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(20), @vcEvent varchar(100))

  as

  insert Schedule

  select @vcDate, @vcEvent

  go

  create procedure DeleteEvent (@idSchedule smallint)

  as

  delete Schedule where idSchedule = @idSchedule

  go

[1]