|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
SQLServer是基于服务器端的中型的数据库,可以适合大容量数据的应用,在功能上管理上也要比Access要强得多。在处理海量数据的效率,后台开发的灵活性,可扩展性等方面强大。DateSelect.asp创建一个日历格局的。。。
<%@LANGUAGE="VBSCRIPT"%>
<%
CodeWrittenbyD.ScottHand
Ifanyerrorsarefound,please
e-mailscott_hand@pobox.comwith
theerrorandthewaytheerror
wascaused
***Purpose:************
*Thisisapagebuilttoshowcalendarfunctionality.
*Description:
*Thisistheinstantiatedfiletoto
*allowtheusertoselectadate.
***********************
IfRequest.Querystring("Page")""Then
PageName=Request.Querystring("Page")
Session("PageName")=PageName
Else
PageName=Session("PageName")
EndIf
IfRequest.Querystring("Form")""Then
FormName=Request.Querystring("Form")
Session("FormName")=FormName
Else
FormName=Session("FormName")
EndIf
IfRequest.Querystring("Element")""Then
ElementName=Request.Querystring("Element")
Session("ElementName")=ElementName
Else
ElementName=Session("ElementName")
EndIf
%>
<HTML>
<HEAD>
<METANAME="GENERATOR"Content="MicrosoftVisualInterDev1.0">
<METAHTTP-EQUIV="Content-Type"content="text/html;charset=iso-8859-1">
<TITLE>SelectDate</TITLE>
</HEAD>
<BODYBGColor="#ded6c5"alink="#526B84"vlink="#526B84">
<SCRIPTLANGUAGE="javascript">
functioncalpopulate(dte){
window.opener.<%=formname&"."&elementname%>.value=dte;
self.close()
}
</SCRIPT>
<%
IfIsDate(Request.QueryString("Date"))Then
BuildDate=Request.QueryString("Date")
Else
IfRequest.Querystring("BMonth")=""Then
BMonth=Month(Now)
Else
BMonth=Request.Querystring("BMonth")
EndIf
IfRequest.QueryString("BYear")""Then
BuildDate=BMonth&"/"&"1"&"/"&_
Request.QueryString("BYear")
Else
BuildDate=BMonth&"/"&"1"&"/"&Right(Year(Now),2)
EndIf
EndIf
Session("CurrentDate")=BuildDate
Thisgivesthepositionofweekdayforthatdate
BuildDayValue=Weekday(BuildDate)
CurrentMonth=Month(BuildDate)
%>
<center>
<table>
<tr>
<tdcolspan="7"align="center">
<hr>
<fontsize=2><b><%=MonthName(CurrentMonth)%><%=Year(BuildDate)%></b>
<br>
<%
BuildDate=DateAdd("d",-1,BuildDate)
IfCurrentMonth<12then
NextMonth=CurrentMonth+1&"&BYear="&Year(BuildDate)
Else
NextMonth="1&BYear="&Year(DateAdd("yyyy",1,BuildDate))
Endif
IfCurrentMonth>1then
PreviousMonth=CurrentMonth-1&"&BYear="&Year(BuildDate)
Else
PreviousMonth="12&BYear="&Year(DateAdd("yyyy",-1,BuildDate))
EndIf
%>
<ahref="DateSelect.asp?BMonth=<%=PreviousMonth%>"><font
size=-2><--Previous</a>
<ahref="DateSelect.asp?BMonth=<%=NextMonth%>"><fontsize=-2>Next--></a>
<hr></td>
</tr>
<tr>
<td><fontsize="-3">Su</td><td><fontsize="-3">Mo</td><td><font
size="-3">Tu</td><td><fontsize="-3">We</td><td><font
size="-3">Th</td><td><fontsize="-3">Fr</td><td><fontsize="-3">Sa</td>
</tr>
<tr>
<tr>
<%
DayPosition=1
Nowloopthroughtablebuildwithblanksuntilfirstdayofmonth
isinposition
ForI=1toBuildDayValue-1
%>
<td><fontsize="-3"></td>
<%
DayPosition=DayPosition+1
Next
DoUntilCurrentMonthMonth(BuildDate)
%>
<%
WhileDayPosition8
%>
<tdalign="center"<%IfDay(BuildDate)=Day(Now)ThenResponse.Write"bgcolor=""#FFFFFF"""%>
calpopulate("&Month(BuildDate)&"/"&Day(BuildDate)&"/"&Right(Year
(BuildDate),2)%>)"><fontsize="-3">
<ahref=""><%=Day(BuildDate)%></a>
</td>
<%
DayPosition=DayPosition+1
BuildDate=DateAdd("d",1,BuildDate)
IfCurrentMonthMonth(BuildDate)then
DayPosition=8
EndIf
Wend
DayPosition=1
%>
</tr><tr>
<%
Loop
%>
</tr>
</table>
</center>
</BODY>
</HTML>
asp可以使用微软的activeX使得网页功能无比强大,不过安全性也较差,而且是基于的windows服务器,所以性能稳定性也一般 |
|