|
查询也许比较麻烦,用ado吧- Public Sub FindCity()
- Dim rs As New ADODB.Recordset
- Dim rst As New ADODB.Recordset
- Dim cnn As New ADODB.Connection
- Dim lngP As Long
- Set cnn = CurrentProject.Connection
- rs.Open "B", cnn, adOpenKeyset, adLockReadOnly
- Do While Not rs.EOF
- rst.Open "A", cnn, adOpenKeyset, adLockOptimistic
- Do While Not rst.EOF
- lng = InStr(rst.Fields(1), rs.Fields(0))
- If lng <> 0 Then
- rst.Fields(2) = rs.Fields(0)
- rst.Update
- End If
- rst.MoveNext
- Loop
- rst.Close
- rs.MoveNext
- Loop
- DoCmd.OpenTable "A"
- rs.Close
- Set rs = Nothing
- Set rst = Nothing
- Set cnn = Nothing
- End Sub
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|