RE: Multiple Access database connections

From: Darshan (Darshan_at_discussions.microsoft.com)
Date: 09/25/04


Date: Sat, 25 Sep 2004 08:09:07 -0700

Since, you have the tables in two seperate databases, create a dataset
object. Create 2 OleBDDataAdapter and 2 OleDBConnection objects (1 for each
Database). Fill the dataset using both the adapters. Create a relationship
between the two tables in the DataSet (on StateCode).

I suggest displaying the States in a listbox, and use the "GetChildRows()"
method of the refStateName table (in the dataset) to display the resulting
StateCodes in a tetbox (assuming there are multiple statecodes per state).

If there is only 1 StateCode per state, then disply both the colomns
directly in a listbox.

Not the best solution, but it works.
Darshan

"Bill Wanschura" wrote:

> I'm new to ADO and I think I'm missing something. I need to connect to two
> different tables on two different Access databases. I have been able to get
> the connections and recordsets set up so I can list the rows in each table.
>
> How do I set up a query using the two tables to cerate another recordset? I
> am so used to Tabledefs and Querydefs that I am not understanding the object
> model of Commands and Recordsets.
>
> My master table (tblMaster) on databaseA has a stateCode field that is also
> on my refStateName table on databaseB. I want to JOIN tblMaster and
> refStateName on stateCode and list the stateCode field from tblMaster and
> the stateName field from refStateName.
>
> What am I missing here?
>
> Bill W.



Relevant Pages

  • Multiple Access database connections
    ... I'm new to ADO and I think I'm missing something. ... different tables on two different Access databases. ... My master table on databaseA has a stateCode field that is also ... on my refStateName table on databaseB. ...
    (microsoft.public.data.ado)
  • Re: Multiple Access database connections
    ... Thanks, Andrew. ... set up a link for all the databases, so I'll try the dataset solution. ... >> model of Commands and Recordsets. ... >> on my refStateName table on databaseB. ...
    (microsoft.public.data.ado)