只能一个一个表的查了
比如:
Dim nms() As String = {"表A","表B",....}
Dim name As String = "张三"
Dim f As Boolean
For Each m As String In nms
If DataTables(m).DataCols.Contains("姓名")
If DataTables(m).DataCols.Contains("姓名")
If DataTables(m).Find("姓名='" & name & "'") IsNot Nothing Then
f = True
Exit For
End If
End If
End If
Next
If f = True Then
msgbox("有")
Else
msgbox("没有,可以删除")
End If
如果都是外部表,建议在数据库里建一个视图,类似:
select 姓名 from 表A union select 姓名 from 表B union .......
然后通过sql判断:select count(*) from 某视图 where 姓名 = '张三'