|
原帖由 dddddd 于 2008-11-19 17:50 发表
这问题好像问过
不知道你出多少钱??[:28][:28]
- Dim rs As New ADODB.Recordset
- Dim rst As New ADODB.Recordset
- Dim strSQL, SQL As String
- Dim I As Long
- strSQL = "select distinct CellName from Tmp_Cell_Neighbors"
- rs.Open strSQL, CurrentProject.Connection, adOpenKeyset, adLockReadOnly
- Do While Not rs.EOF
- SQL = "select AdjacentCellID from Tmp_Cell_Neighbors where CellName='" & rs.Fields(0) & "'"
- rst.Open SQL, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
- Do While Not rst.EOF
- I = I + 1
- rst(0) = I
- rst.MoveNext
- Loop
- rst.UpdateBatch
- rst.Close
- rs.MoveNext
- I = 0
- Loop
- rs.Close
- Set rst = Nothing
- Set rs = Nothing
复制代码 |
|