|
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)) Then
strTemp = "2008-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 - 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
红字部分为最后一列,为null的情况则变量为"2008-1-1",我现在想加一个条件。
1.倒数第二列,也为null的情况则变量为"2008-1-1",该如何改写代码? (请各位指导,谢谢)
[ 本帖最后由 boy1 于 2009-1-12 09:53 编辑 ] |
|