Re: Query Two Databases
- From: "ekkehard.horner" <ekkehard.horner@xxxxxxxx>
- Date: Wed, 28 Dec 2005 08:58:25 +0100
JSzabo wrote:
[...]Hi Ekkehard,
Thanks again for the idea. Unfortunately, the password on the external db causes problems. I got the following error message when I ran a test query: “Not a valid password”.
I will tinker around some with this idea to see if I can specify the password in the SQL string.
JSzabo wrote:
Hi,
I am (still) developing with VB 6.0 and MS Access 2000 on Win98-R2.
Is it possible to easily/reliably query two tables that each exist in a different database, then return the results in a single recordset? Or must I create a linked-table reference in one of the databases? Or must I do something else … ?
[...] Using 2 copies of nordwind.mdb (c:\temp\nordwind1.mdb, c:\temp\nordwind2.mdb) the statement
select B.[Bestell-Nr] , B.[Kunden-Code] , K.[Kunden-Code] , K.[Firma] from Kunden as K , Bestellungen as B in "c:\temp\nordwind2.mdb" where B.[Kunden-Code] = K.[Kunden-Code]
works (for me) as expected when executed from a oledb/jet connection to c:\temp\nordwind1.mdb. I admit, the syntax of a IN-clause is hard to get right (I had to experiment a bit), so YMMV.
I would try to
(1) create a ODBC data source for the second database and
use '... as B in "ODBC;DSN=<yourdsn>"'
(2) tinker with the connection string
'... as B in "Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=c:\temp\nordwind2.mdb;
uid=<User ID>; ? User=<User ID>;
pwd=<Strong Password> ? Password=<Strong Password>
"'
Perhaps
http://support.microsoft.com/kb/q245587/
will give you some hints to get started.
.- Follow-Ups:
- Re: Query Two Databases
- From: JSzabo
- Re: Query Two Databases
- References:
- Re: Query Two Databases
- From: ekkehard.horner
- Re: Query Two Databases
- Prev by Date: Unexpected deadlocks! why ?
- Next by Date: Re: Query Two Databases
- Previous by thread: Re: Query Two Databases
- Next by thread: Re: Query Two Databases
- Index(es):
Relevant Pages
|
|