Insert Date and Time into Access
2018-09-06 11:58
<%
FunctionAccessDateTime(dateandtime)
DimmyDay
DimmyMonth
DimmyYear
myDay=Day(dateandtime)
IfLen(myDay)=1ThenmyDay=0&myDay
myMonth=Month(dateandtime)
IfLen(myMonth)=1ThenmyMonth=0&myMonth
myYear=Year(dateandtime)
AccessDateTime=myYear&-&myMonth&-&myDay&&Time()
EndFunction
Dimconnection
DimSQL,sConnString
SQL=InsertINTOtblDate(dDate)VALUES(#&AccessDateTime(NOW()))
sConnString=PROVIDER=Microsoft.Jet.OLEDB.4.0;&_
DataSource=&Server.MapPath(datedb.mdb)
connection.Open(sConnString)
connection.execute(SQL)
Connection.Close
SetConnection=Nothing
%>
上一篇:asp实现表格3列5行
文章标题:Insert Date and Time into Access
文章链接:http://soscw.com/essay/9841.html