borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Open/Close/Lock Access DBase)Next Topic (Datareport and Invalid data source) New Topic New Poll Post Reply
AndreaVB Forum : Database : Help on SQL???
Poster Message
natashag
Level: Guest


icon Help on SQL???

Hello,

I am using an ADODC to access my Access DB. I have the datagrid retrieving the fields, but now I need to create a relationship to join two of my tables together to get the correct information shown on my database through my program (not create the relationships through Access).

I typed...
select * from tblEmployees
Inner Join tblLocations On
tblEmployees.fldLocationID = tblLocations.fldLocationID

in the property page/recordsourve tab/command text box.

Now I need it to show the correlating Location Name instead of the Location ID in the column. What is the SQL code to do this?

Thank a mill, Tasha

03-10-2002 at 11:12 PM
| Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 891
icon Re: Help on SQL???

Hi, try:
select e.Name, e.Address, l.LocationName
from
tblEmployees e INNER JOIN tblLocations l ON (e.fldLocationID=l.fldLocationID)

You either have to specify all fields in the SELECT, or use Retrieve Fields method on the grid and hide the field you don't want.

Hope this helps,
Kieron

____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

08-10-2002 at 09:17 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Database : Help on SQL???
Previous Topic (Open/Close/Lock Access DBase)Next Topic (Datareport and Invalid data source) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder