RE: Multiple Access database connections
From: Darshan (Darshan_at_discussions.microsoft.com)
Date: 09/25/04
- Next message: whitetulips: "Re: exception error when accessing SQL database"
- Previous message: Darshan: "Connecting to AS400"
- In reply to: Bill Wanschura: "Multiple Access database connections"
- Next in thread: Bill Wanschura: "RE: Multiple Access database connections"
- Reply: Bill Wanschura: "RE: Multiple Access database connections"
- Reply: Bill Wanschura: "RE: Multiple Access database connections"
- Messages sorted by: [ date ] [ thread ]
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.
- Next message: whitetulips: "Re: exception error when accessing SQL database"
- Previous message: Darshan: "Connecting to AS400"
- In reply to: Bill Wanschura: "Multiple Access database connections"
- Next in thread: Bill Wanschura: "RE: Multiple Access database connections"
- Reply: Bill Wanschura: "RE: Multiple Access database connections"
- Reply: Bill Wanschura: "RE: Multiple Access database connections"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|