RE: Multiple Access database connections

From: Bill Wanschura (BillWanschura_at_discussions.microsoft.com)
Date: 09/27/04


Date: Mon, 27 Sep 2004 05:55:12 -0700

Thanks, I'll give it a try!
Bill W.

"Darshan" wrote:

> 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.