大家先看看代码 ,
<%
Function DateTimeFormat(DateTime,Format)
Select case Format
case "1"
DateTimeFormat=Year(DateTime)&"年"&Month(DateTime)&"月"&Day(DateTime)&"日"
case "2"
DateTimeFormat=Month(DateTime)&"月"&Day(DateTime)&"日"
case "3"
DateTimeFormat =Year(DateTime)&"年/"&Month(DateTime)&"月/"&Day(DateTime)&"日"
case "4"
DateTimeFormat =Month(DateTime)&"月/"&Day(DateTime)&"日"
case "5"
DateTimeFormat =Month(DateTime)&"月"&Day(DateTime)&"日"&FormatDateTime(DateTime,4)&""
case "6"
temp ="周日,周一,周二,周三,周四,周五,周六"
temp = split(temp,",")
DateTimeFormat = temp(WeekDay(DateTime)-1)
case else
DateTimeFormat = DateTime
End Select
End Function
vTime = DateTimeFormat(now(),1)
set conn = server.CreateObject("adodb.connection")
conn.open "provider=sqloledb.1;server=.;pwd=;uid=sa;database=FluxStart"
sql="insert into Visitors(vTime) values('"&vTime&"')"
conn.Execute(sql)
%>
这段代码是在数据库中写入时间,数据库对应字段是(vTime varchar(50)) 可是无法执行,我后来单独测试函数,函数没错;然后我测试数据库,如果把该函数在页面中删除,插入任意其他时间值,又是可执行的 。可是我重新加入该函数,为什么就很难执行,执行多了就报错:HTTP403.9错误,web连接用户过多,无法显示。(超级郁闷!)
请各位同仁帮忙测试指正一下,在下感激不尽!!!