不是吧,千年虫问题吗? 我是这么写的没有错误: Dim cn As New ADODB.Connection '连接对象 Dim rs As New ADODB.Recordset '记录集对象If cn.State = adStateOpen Then cn.Close End If '打开数据库连接 cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=123.mdb;Persist Security Info=False" '填充记录集 rs.Open "select 存时间 from DATA", cn, adOpenStatic, adLockOptimistic rs.AddNew rs.Fields("时间") = Now rs.Update '关闭、清除ADO对象 rs.Close Set rs = Nothing cn.Close Set cn = Nothing
如
RS.ADDNEW
RS!TIME=DATE
我是这么写的没有错误:
Dim cn As New ADODB.Connection '连接对象
Dim rs As New ADODB.Recordset '记录集对象If cn.State = adStateOpen Then
cn.Close
End If
'打开数据库连接
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=123.mdb;Persist Security Info=False" '填充记录集
rs.Open "select 存时间 from DATA", cn, adOpenStatic, adLockOptimistic
rs.AddNew
rs.Fields("时间") = Now
rs.Update
'关闭、清除ADO对象
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing
但存完后变成1905-6-3
rs.Open "select 时间 from DATA", cn, adOpenStatic, adLockOptimistic
rs.AddNew