|
3#
楼主 |
发表于 2009-1-12 10:17:12
|
只看该作者
这样改写还出错?请版主帮我看看
rs.Open "表1", CurrentProject.Connection, adOpenKeyset, adLockReadOnly
rst.Open "表2", CurrentProject.Connection, adOpenKeyset, adLockOptimistic
Do While Not rs.EOF
If IsNull(rs.Fields(rs.Fields.Count - 1)) or IsNull(rs.Fields(rs.Fields.Count - 2))Then
strTemp = "2008-1-1"
Else
strTemp = rs.Fields(rs.Fields.Count - 1)
strTemp = rs.Fields(rs.Fields.Count - 2)
End If
dtmArray() = Split(Replace(strTemp, ".", "-"), "/")
For I = 0 To UBound(dtmArray)
With rst
.AddNew
For J = 0 To rs.Fields.Count - 3
.Fields(J) = rs.Fields(J)
Next
.Fields(J) = Replace(rs.Fields(J), ".", "-")
.Fields(J + 1) = CDate(dtmArray(I))
.Update '保存
End With
Next
rs.MoveNext
.Fields(J) = Replace(rs.Fields(J), ".", "-") 提示出错
[ 本帖最后由 boy1 于 2009-1-12 10:28 编辑 ] |
|