473,387 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Query data from 2 MDB

Hi all,

I need to query data from at least 2 MDB files that have a common CardNo
field. The tables that hold those info are in different MDBs, how can I
run select SQL statement under VB.NET environment?

For example:
In A.MDB, table CardInfo has fields CardNo and Name
In B.MDB, table Record has fields CardNo, Date, Controller

So what is the select phrase like,
Select
[a.cardinfo.cardno],[a.cardinfo.name],[b.record.date],[b.record.controller]
From [a.cardinfo],[b.record]
where [a.cardinfo.cardno]=[b.record.cardno]

Thanks.

--
Best regards,
RL
Nov 21 '05 #1
2 1225
RL,

This depends, when you use two tables, you are doing it with simple selects.
If you want to join a table you have to use more the SQL language. Than you
can as well not use standards as the designer to update using the
dataadapter.

In my opinion in the last situation is this a newsgroup where people are
active who like these things.

Adonet
news://msnews.microsoft.com/microsof...amework.adonet

Web interface:
http://communities2.microsoft.com/co...amework.adonet

I hope this helps something,

Cor
Nov 21 '05 #2
On Tue, 31 May 2005 10:01:23 +0800, "Lurc" <lu*****@spam.hotmail.com> wrote:

¤ Hi all,
¤
¤ I need to query data from at least 2 MDB files that have a common CardNo
¤ field. The tables that hold those info are in different MDBs, how can I
¤ run select SQL statement under VB.NET environment?
¤
¤ For example:
¤ In A.MDB, table CardInfo has fields CardNo and Name
¤ In B.MDB, table Record has fields CardNo, Date, Controller
¤
¤ So what is the select phrase like,
¤ Select
¤ [a.cardinfo.cardno],[a.cardinfo.name],[b.record.date],[b.record.controller]
¤ From [a.cardinfo],[b.record]
¤ where [a.cardinfo.cardno]=[b.record.cardno]
¤
¤ Thanks.

See if the below works for you. Make sure to connect to database A.MDB and change the DATABASE path
in the SQL statement to the location of database B.MDB.

"SELECT CardInfo.[CardNo], CardInfo.[Name], Record.[Date], Record.Controller FROM CardInfo INNER
JOIN [MS Access;DATABASE=C:\My Databases\B.mdb;].[Record] ON (CardInfo.[CardNo]=Record.[CardNo])"
Paul
~~~~
Microsoft MVP (Visual Basic)
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: netpurpose | last post by:
I need to extract data from this table to find the lowest prices of each product as of today. The product will be listed/grouped by the name only, discarding the product code - I use...
12
by: Joe Stanton | last post by:
Hello Group I have a query that works in Oracle and SQL Server, but fails in Microsoft Access. The query is: SELECT data fromTABLE1 WHERE data>='A&' AND data<'A''' Here is my sample data:
6
by: Martin Lacoste | last post by:
Ok, before I headbutt the computer... don't know why when I add criteria in a query, I get an 'invalid procedure call'. I also don't know why after searching the help in access, the various access...
6
by: jjturon | last post by:
Can anyone help me?? I am trying to pass a Select Query variable to a table using Dlookup and return the value to same select query but to another field. Ex. SalesManID ...
6
by: tizmagik | last post by:
I am having a lot of difficulty generating a CrossTab Query based report. I have looked online for several tutorials and whatnot but I have not been able to really find what I'm looking for, nor...
1
by: rdemyan via AccessMonster.com | last post by:
My application has a table that contains information on buildings. The building data comes from another database and is imported from a spreadsheet into my application. Originally, I thought...
5
by: Wired Hosting News | last post by:
I tried to be breif and give a scenario so as not to be overlooked because it was soooo long. Let me give you real world. I am a manufacturer of goods and produce 11 items that are distributed...
2
by: John T Ingato | last post by:
If I run a query that calculates the sales data for all the inventory level in a table, how do I go about saving that sales data into a permanent table? I plan I using this sales data often, and...
16
by: ARC | last post by:
Hello all, So I'm knee deep in this import utility program, and am coming up with all sorts of "gotcha's!". 1st off. On a "Find Duplicates Query", does anyone have a good solution for...
2
by: lindabaldwin | last post by:
Hello everyone, I am fairly new to VBA. I have a worksheet in Excel, named "Data Sheet" from which I am trying to query data. This worksheet contains the following data: unit (column A), date...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.