Insert Date and Time into Access


<%
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
%>



相关阅读:
面向Java开发人员的Ajax:Java对象序列化下
extjs 学习笔记 四 带分页的grid
Ubuntu9.04下CUDA环境的搭建
教你轻松的解决多实例的相关问题
Win2000环境下使用BIND作域名服务器
Windows 7升级风险与升级收益分析
vbs SendKey 用法 Sendkey 键盘对应的码表
[转]去百度面试的javascript 收获
PHP 数组入门教程小结
在FreeBSD中安装双网卡实例
ip138之asp小偷程序代码
教你一招配置Windows系统的页面文件
用php实现pop3邮件的收取
用JavaScript调用WebService的示例
快速导航

Copyright © 2016 phpStudy |