|
Private Sub Command0_Click()
Dim prs As New ADODB.Recordset
Dim qrs As New ADODB.Recordset
prs.Open "Select * FROM tb2 ", CurrentProject.Connection, 3, 3
If Not prs.EOF Then
prs.MoveFirst
Do While Not prs.EOF
qrs.Open "select * from tb1 where no='" & prs.Fields("no").Value & "'", CurrentProject.Connection, 3, 3
If qrs.RecordCount < 1 Then
prs.Fields("s").Value = "n"
Else
prs.Fields("s").Value = "y"
End If
prs.Update
prs.MoveNext
qrs.Close
Loop
End If
prs.Close
MsgBox "执行完成"
End Sub
可以运行,但是就是表2的no字段的数据在表1的no字段中存在重复也会标注为N。帮查看一下代码。错在哪里了。谢谢各位大神 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|