ASP网站制作之在access中增添夏历撑持模块
实现规模效益。与传统的用户拥有硬件软件所有权和使用权以及传统的应用服务商提供一对一的服务模式不同,ASP拥有应用系统所有权,用户拥有使用权,应用系统集中放在ASP的数据中心中,集中管理,分散使用,以一对多的租赁的形式为众多用户提供有品质保证的应用技术服务,实现规模效益。新建模块,复制上面两个函数.glgetnl(),strnl()在查询中利用:selectglgetnl(born)asnlbornfromempolyeewhereglgetnl(born)>"05012"orderbyglgetnl(born)
下面的查询前往夏历诞辰年夜于蒲月十二员工列表,并按夏历诞辰排序.
(声明:这两个函数不是从零入手下手写的,是修正了网上不晓得谁的程序代码而来的.
到google输出关头字vb夏历能够找到这篇文章的多处援用
原本是想在ASP中间接挪用的,厥后想到放到数据库中,但在Access中可使用,在ASP中利用ADO没法挪用.在调试中发明原数据中的1998夏历闰月为小月而不是原代码中的年夜月,另修正了求干支算法.也没往和原作者接洽,包涵.)
<P>
输出date,前往"mmlddyyyy"mm:月份;l:1,闰月,0,寻常月;dd:日;yyyy年份
Functionglgetnl(ByValgldate)
DimdaList(111)
1900to1909
daList(0)="010010110110180131"
daList(1)="010010101110000219"
daList(2)="101001010111000208"
daList(3)="010100100110150129"
daList(4)="110100100110000216"
daList(5)="110110010101000204"
daList(6)="011010101010140125"
daList(7)="010101101010000213"
daList(8)="100110101101000202"
daList(9)="010010101110120122"
daList(10)="010010101110000210"
daList(11)="101001001101160130"
daList(12)="101001001101000218"
daList(13)="110100100101000206"
daList(14)="110101010100150126"
daList(15)="101101010101000214"
daList(16)="010101101010000204"
daList(17)="100101101101020123"
daList(18)="100101011011000211"
daList(19)="010010011011170201"
daList(20)="010010011011000220"
daList(21)="101001001011000208"
daList(22)="101100100101150128"
daList(23)="011010100101000216"
daList(24)="011011010100000205"
daList(25)="101011011010140124"
daList(26)="001010110110000213"
daList(27)="100101010111000202"
daList(28)="010010010111120123"
daList(29)="010010010111000210"
daList(30)="011001001011060130"
daList(31)="110101001010000217"
daList(32)="111010100101000206"
daList(33)="011011010100150126"
daList(34)="010110101101000214"
daList(35)="001010110110000204"
daList(36)="100100110111030124"
daList(37)="100100101110000211"
daList(38)="110010010110170131"
daList(39)="110010010101000219"
daList(40)="110101001010000208"
daList(41)="110110100101060127"
daList(42)="101101010101000215"
daList(43)="010101101010000205"
daList(44)="101010101101140125"
daList(45)="001001011101000213"
daList(46)="100100101101000202"
daList(47)="110010010101120122"
daList(48)="101010010101000210"
daList(49)="101101001010170129"
daList(50)="011011001010000217"
daList(51)="101101010101000206"
daList(52)="010101011010150127"
daList(53)="010011011010000214"
daList(54)="101001011011000203"
daList(55)="010100101011130124"
daList(56)="010100101011000212"
daList(57)="101010010101080131"
daList(58)="111010010101000218"
daList(59)="011010101010000208"
daList(60)="101011010101060128"
daList(61)="101010110101000215"
daList(62)="010010110110000205"
daList(63)="101001010111040125"
daList(64)="101001010111000213"
daList(65)="010100100110000202"
daList(66)="111010010011030121"
daList(67)="110110010101000209"
daList(68)="010110101010170130"
daList(69)="010101101010000217"
daList(70)="100101101101000206"
daList(71)="010010101110150127"
daList(72)="010010101101000215"
daList(73)="101001001101000203"
daList(74)="110100100110140123"
daList(75)="110100100101000211"
daList(76)="110101010010180131"
daList(77)="101101010100000218"
daList(78)="101101101010000207"
daList(79)="100101101101060128"
daList(80)="100101011011000216"
daList(81)="010010011011000205"
daList(82)="101001001011140125"
daList(83)="101001001011000213"
daList(84)="1011001001011A0202"
daList(85)="011010100101000220"
daList(86)="011011010100000209"
daList(87)="101011011010060129"
daList(88)="101010110110000217"
daList(89)="100100110111000206"
daList(90)="010010010111150127"
daList(91)="010010010111000215"
daList(92)="011001001011000204"
daList(93)="011010100101030123"
daList(94)="111010100101000210"
daList(95)="011010110010180131"
daList(96)="010110101100000219"
daList(97)="101010110110000207"
daList(98)="100100110110050128"
daList(99)="100100101110000216"
daList(100)="110010010110000205"
daList(101)="110101001010140124"
daList(102)="110101001010000212"
daList(103)="110110100101000201"
daList(104)="010110101010120122"
daList(105)="010101101010000209"
daList(106)="101010101101170129"
daList(107)="001001011101000218"
daList(108)="100100101101000207"
daList(109)="110010010101150126"
daList(110)="101010010101000214"
daList(111)="101101001010000214"
OnErrorResumeNext
DimconDateAsDate
DimtYear,AddMonth,AddDay,AddYear,getDay,iAsInteger
DimRunYueAsBoolean
tYear=Year(gldate)
IftYear>2010OrtYear<1901Then
glgetnl=""
ExitFunction假如不是无效有日期,加入
EndIf
RunYue=False
AddYear=tYear
Do
AddMonth=CInt(Mid(daList(AddYear-1900),15,2))
AddDay=CInt(Mid(daList(AddYear-1900),17,2))
conDate=DateSerial(AddYear,AddMonth,AddDay)
getDay=DateDiff("d",conDate,gldate)
IfgetDay<0ThenAddYear=AddYear-1
LoopWhilegetDay<0
AddDay=1
AddMonth=1
Fori=1TogetDay
AddDay=AddDay+1
IfAddDay=30+CInt(Mid(daList(AddYear-1900),AddMonth,1))Or(RunYueAndAddDay=30+CInt(Mid(daList(AddYear-1900),13,1)))Then
IfRunYue=FalseAndAddMonth=CInt("&H"&Mid(daList(AddYear-1900),14,1))Then
RunYue=True
Else
RunYue=False
AddMonth=AddMonth+1
EndIf
AddDay=1
EndIf
Next
glgetnl=IIf(AddMonth>9,CStr(AddMonth),"0"+CStr(AddMonth))+IIf(RunYue,"1","0")+IIf(AddDay>9,CStr(AddDay),"0"+CStr(AddDay))+CStr(AddYear)
EndFunction
输出sNl="mmlddyyyy"mm:月份;l:1,闰月,0,寻常月;dd:日;yyyy年份
函数前往"XX月XX",属相存进sShuXinag,干支记年存进sYear
Functionstrnl(ByValsNl,ByRefsShuXiang,ByRefsYear)
Dimlnl_md,lnl_cm,lnl_tiangan,lnl_dizhi,lnl_shu
lnl_md="月朔初二初三初四初五初六初七初八初九初十十一十二十三十四十五十六十七十八十九二十廿一廿二廿三廿四廿五廿六廿七廿八廿九三十"
lnl_cm="正二三四五六七八九十冷腊"
lnl_tiangan="甲乙丙丁戊已庚辛壬癸"
lnl_dizhi="子丑寅卯辰巳午未申酉戌亥"
lnl_shu="鼠牛虎兔龙蛇马羊猴鸡狗猪"
OnErrorResumeNext
Dimiy,im,id,isLeap
im=CInt(Left(sNl,2))
isLeap=CInt(Mid(sNl,3,1))
id=CInt(Mid(sNl,4,2))
iy=CInt(Right(sNl,4))
strnl=Mid(lnl_cm,im,1)&"月"&Mid(lnl_md,(id-1)*2+1,2)
IfisLeap>0Thenstrnl="闰"&strnl
iy=iy-4
sShuXiang=Mid(lnl_shu,(iyMod12)+1,1)
sYear=Mid(lnl_tiangan,(iyMod10)+1,1)&Mid(lnl_dizhi,(iyMod12)+1,1)
EndFunction
减少客户内IT专业人才缺乏带来的影响。ASP的客户员工利用浏览器进入相关的应用软件,简单易用,无需专业技术支持。 代码逻辑混乱,难于管理:由于ASP是脚本语言混合html编程,所以你很难看清代码的逻辑关系,并且随着程序的复杂性增加,使得代码的管理十分困难,甚至超出一个程序员所能达到的管理能力,从而造成出错或这样那样的问题。 Request:从字面上讲就是“请求”,因此这个是处理客户端提交的东东的,例如Resuest.Form,Request.QueryString,或者干脆Request("变量名") 代码的可重用性差:由于是面向结构的编程方式,并且混合html,所以可能页面原型修改一点,整个程序都需要修改,更别提代码重用了。 运用ASP可将VBscript、javascript等脚本语言嵌入到HTML中,便可快速完成网站的应用程序,无需编译,可在服务器端直接执行。容易编写,使用普通的文本编辑器编写,如记事本就可以完成。由脚本在服务器上而不是客户端运行,ASP所使用的脚本语言都在服务端上运行。 用户端的浏览器不需要提供任何别的支持,这样大提高了用户与服务器之间的交互的速度。 Session:这个存储跟客户端会话过程的数据,默认20分钟失效 从事这个行业,那么你可以学ASP语言,简单快速上手,熟练dreamweav排版,写asp代码,熟练photoshop处理图片,打好基础就行了 那么,ASP.Net有哪些改进呢?
页:
[1]