468,765 Members | 1,657 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,765 developers. It's quick & easy.

MS Access and DB2 Linked Tables Query

I can pull up an MS Access database, link DB2 tables to it (using a
System DSN) and create queries that return differences between a MS
Access table and a DB2 table. I am able to query both the MS Access
table and the DB2 table at the same time in the same SQL statement.

My problem is I am trying to duplicate this functionality in C# and I
cannot figure it out. The SQL that MS Access builds is:

FROM (DPS_OFFICE_ALIAS LEFT JOIN 0001000_20060424_084844_O ON
(DPS_OFFICE_ALIAS.TRADE_FIRM = [0001000_20060424_084844_O].TRADE_FIRM)
[0001000_20060424_084844_O].TRADE_OFFICE)) INNER JOIN
(([0001000_20060424_084844_O].TRADE_FIRM) Is Null) AND
(([0001000_20060424_084844_O].TRADE_OFFICE) Is Null));

The "DPS_OFFICE_ALIAS" is the DB2 table. 0001000_20060424_084844_O is
the access table. This query returns records in the DPS_OFFICE_ALIAS
table that are not in the 0001000_20060424_084844_O table.

I create the MS Access databases in code so the ODBC connection
information to the DB2 tables is not in the database.

I see I have 2 choices;
1. Link the DB2 tables to the current MS Access database. How do I do
this in code?

2. Place the connection information to the DB2 tables in the SQL. How
do I do this in code?

Any help or observations will be greatly appreciated.


Apr 26 '06 #1
0 1203

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Jon Ole Hedne | last post: by
8 posts views Thread by Alfonso Esteban Gonzalez Sencion | last post: by
52 posts views Thread by Neil | last post: by
3 posts views Thread by mnjkahn via AccessMonster.com | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.