|
- Dim rs As New ADODB.Recordset
- Dim sSQL As String
- Dim ZH As String
- Dim I, J As Integer
- CurrentDb.Execute "DELETE FROM TEMP"
- rs.Open "A", CurrentProject.Connection, adOpenKeyset, adLockReadOnly
- Do While Not rs.EOF
- For I = 2 To rs.Fields.Count - 2
- For J = I + 1 To rs.Fields.Count - 1
- If rs.Fields(I) + rs.Fields(J) = 2 Then
- ZH = rs.Fields(I).Name & "-" & rs.Fields(J).Name
- sSQL = "INSERT INTO TEMP VALUES('" & ZH & "',1)"
- CurrentDb.Execute sSQL
- End If
- Next
- Next
- rs.MoveNext
- Loop
- rs.Close
- Set rs = Nothing
复制代码
临时表 temp(组合,次数) |
|