Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Managing a complex join-query with the datacontrol in VB

Status
Not open for further replies.

Perra

Technical User
Dec 28, 2000
38
SE
How to manage this query with the "intrinsic data control" in VB vs a database in Access?

SELECT Namn FROM ARTIST WHERE Skiva.Snr = SK_AR.Snr and SK_AR.Anr = ARTIST.Anr

If you run this query and want the results to show up in the DB-Grid, the query just returns the results from the fields in the first table - that is "Skiva"...

Why this? Do you have to have a data control for every table?

I´m anxious to know, since I´m developing an application for sports club...

Please help me!

/Perra
 
Perra - you have to use a join to bring back fields from multiple tables. Your sql statements asks only for the name field. You should be able to do an implicit join by simply adding to your current statement
but the easiest way to do this is go into access
create a query that returns the data the way you want it too and then paste that into your VB program (you might have to make some tweaks but minor) - for the recordsource of your datacontrol.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top