|
日期出现错误是因为,原数据有误引起的,你说11月份有31天的吗??- Private Sub Command0_Click()
- Dim rs As New ADODB.Recordset
- Dim rst As New ADODB.Recordset
- Dim dtmArray() As String
- Dim strTemp As String
- Dim I As Integer, J As Integer
- rs.Open "a", CurrentProject.Connection, adOpenKeyset, adLockReadOnly
- rst.Open "b", CurrentProject.Connection, adOpenKeyset, adLockOptimistic
- Do While Not rs.EOF
- If IsNull(rs.Fields(rs.Fields.Count - 1)) Then
- strTemp = "1900-1-1"
- Else
- strTemp = rs.Fields(rs.Fields.Count - 1)
- End If
- dtmArray() = Split(Replace(strTemp, ".", "-"), "/")
- For I = 0 To UBound(dtmArray)
- With rst
- .AddNew
- For J = 0 To rs.Fields.Count - 2
- .Fields(J) = rs.Fields(J)
- Next
- .Fields(J) = CDate(dtmArray(I))
- .Update
- End With
- Next
- rs.MoveNext
- Loop
- rst.Close
- rs.Close
- Set rs = Nothing
- Set rst = Nothing
- Me.b.Requery
- Me.Command1.SetFocus
- Me.Command0.Enabled = False
- Me.签约时间开始.Enabled = True
- End Sub
复制代码
[ 本帖最后由 Henry D. Sy 于 2008-12-14 17:17 编辑 ] |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|