数据库为access,主要是connection属性不知道怎么设置啊,如下:ADOquery1.sql.add(‘select *
from table1 as t1
where exists(
select *
from table2 as t2
where t1.f1=t2.f1)‘);
t1和 t2分别是两个数据库中的表,ADOquery1的connection属性设置的是adoconnection1,但t2是通过adoconnection2连接的这样就不能查询啊,有没有解决的办法啊
谢谢
from table1 as t1
where exists(
select *
from table2 as t2
where t1.f1=t2.f1)‘);
t1和 t2分别是两个数据库中的表,ADOquery1的connection属性设置的是adoconnection1,但t2是通过adoconnection2连接的这样就不能查询啊,有没有解决的办法啊
谢谢
where Exists(
Select * from Table2 in '库2.MDB' as t2 where t1.f1=t2.f1未测试!
方式如上,自己根据实际情况做一些变更
如下:
ADOquery1.sql.add('select * from ComboBox1.Text ');
ADOquery1.sql.add('where exists ( select * from ComboBox2.Text
in '+''''+edit2.text+''' )');但系统报错是“找不到文件D:\源代码\ComboBox1.mdb”,怎么冒出个ComboBox1.mdb啊!
请教!
请教!
是可以同时访问两个mdb数据库的
如果是sqlserver或oracle等可以建立DBlink来实现多个数据库的访问
ADOquery1.sql.add('where exists ( select * from '+ComboBox2.Text+' in '+''''+edit2.text+''' )'); 试试。