概述
<%
Function AccessDateTime (dateandtime)
Dim myDay
Dim myMonth
Dim myYear
myDay = Day(dateandtime)
If Len(myDay)=1 Then myDay="0" & myDay
myMonth = Month(dateandtime)
If Len(myMonth)=1 Then myMonth="0" & myMonth
myYear = Year(dateandtime)
AccessDateTime = myYear & "-" & myMonth & "-" & myDay & " " & Time()
End Function
Dim connection
Dim SQL, sConnString
SQL="Insert INTO tblDate (dDate) VALUES (#" & AccessDateTime(NOW()) & "#)"
sConnString="PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("datedb.mdb")
Set connection = Server.CreateObject("ADODB.Connection")
connection.Open(sConnString)
connection.execute(SQL)
Connection.Close
Set Connection = Nothing
%>
最后
以上就是俊秀糖豆为你收集整理的Insert Date and Time into Access的全部内容,希望文章能够帮你解决Insert Date and Time into Access所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复