没有改好,再改:
create view vw_test
as
select A.a as t from A
union all
select B.b as t from B
union all
select C.c as t from C
go
select * from vw_test where [你要的条件]
试图不行,一张表一张表找吧,
dim tablename(2) as string
dim feildname(2) as string
for i=0 to 2
strsql="select * from " & tablename(i) & "where " & feildname(0) &"='" & text1.text & "'"
rs.open conn,strsql,2,2
if not rs.eof then
msgbox "Ok"
exit sub
end if
next i
tablename和feildname提前把表名合资段名填入