|
本帖最后由 红尘如烟 于 2010-2-5 16:12 编辑
- Dim strName() As String
- Dim intCount As Integer
- Dim intI As Integer
- Dim rst As New ADODB.Recordset
- rst.Open "表1", CurrentProject.Connection, adOpenKeyset, adLockOptimistic
- Do Until rst.EOF
- strName() = Split(rst!姓名, ",")
- intCount = UBound(strName)
- If intCount > 0 Then
- For intI = 0 To intCount
- CurrentDb.Execute "INSERT INTO 表2(班级,姓名) SELECT '" & rst!班级 & "','" & strName(intI) & "' FROM 表1"
- Next
- End If
- rst.MoveNext
- Loop
- rst.Close
- Set rst = Nothing
复制代码 |
|