chunfeng.asp
' 该页面可以看到已安排了哪些事情,并在底部链接可按月前后翻动.
' 该代码包含获得数据连接的函数,如果数据源一旦有变化,则只有一个位置需要编辑连接信息(服务器、用户和口令).
<@ language="vbscript"
enablesessionstate = false %>
<%
' 表头包括用来启动所有页的文件,包括全局函数.
option explicit
response.buffer = true
response.expires = 0
sub dochunfeng(strtitle)
%>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<title>星河影动之精英日程安排<%= strtitle %></title>
</head>
<body bgcolor="white" link="blue" alink="blue" vlink="blue">
<basefont face="verdana, arial">
<center><h1>我的日程安排</h1>
<h3><%= strtitle %></h3>
<%
' 创建数据库连接.
end sub
' 调用connection 对象 execute 方法,将希望执行的命令的文本字符串传入,一旦有了记录集,就可在其中循环.
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
' 作为结果,使用set命令传出新连接.
set getdataconnection = oconn
end function
%>
calendar.sql
-- 建立sql服务器端.只需保存表明事件性质的一个文本字符串(最长为100个字符)即可.
-- 创建表
create table schedule
(
idschedule smallint identity primary key,
dtdate smalldatetime not null,
vcevent varchar(100) not null
)
go
-- 存储过程
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]
如对本文有疑问, 点击进行留言回复!!
如何用Android studio开发一个实现基本功能的新闻app?——简闻(源码及教程)
AndroidStudio自动生成SVN/Git .ignore配置文件
BaseRecyclerViewAdapterHelper万能适配器简单总结
网友评论