943,605 Members | Top Members by Rank

Ad:
You are currently viewing page 1 of this multi-page discussion thread
Sep 23rd, 2007
0

Joining two tables in VB 6

Expand Post »
hi to everyone,
Im creating an application which it can show all records of the two tables in single form. its like costumerTable and OrderList. how can i show a record of specific costumer from costumertable together with his product order details from OrderList table. Supposed I have costumerNo field from my costumertable and also i have costumerNo field in my Orderlist table. I also wants to show the order details in datagrid view supposed costumer bought 5 items. can anyone help me find solution. any help we'll be appreciated. thanks
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jhowell is offline Offline
4 posts
since Sep 2007
Sep 24th, 2007
0

Re: Joining two tables in VB 6

let's say you have variable costumernr with the costumer's nummer and variable amount
adodc1.recordsource = "Select * from tblorder where costumerno = " & costumernr
adodc1.refresh
amount = adodc1.recordcount 'gives you the amount of records with that costumer nummer

do while not adodc1.recordset.eof
'do whatever you want to do with the orders of that costumer nummer
loop
Reputation Points: 10
Solved Threads: 16
Posting Whiz in Training
plusplus is offline Offline
207 posts
since Jul 2007
Sep 24th, 2007
0

Re: Joining two tables in VB 6

Join both the tables using SQL command and display the output on grid.
Featured Poster
Reputation Points: 665
Solved Threads: 427
Posting Genius
debasisdas is offline Offline
6,406 posts
since Feb 2007
Sep 24th, 2007
0

Re: Joining two tables in VB 6

Join the 2 tables by use of the LEFT JOIN command in SQL.
Reputation Points: 28
Solved Threads: 71
Posting Pro
ryan_vietnow is offline Offline
578 posts
since Aug 2007
Sep 24th, 2007
0

Re: Joining two tables in VB 6

Click to Expand / Collapse  Quote originally posted by debasisdas ...
Join both the tables using SQL command and display the output on grid.
can you please show me your code in LEFT JOIN. I really do not know how is it. thanks
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jhowell is offline Offline
4 posts
since Sep 2007
Sep 25th, 2007
0

Re: Joining two tables in VB 6

Kindly post both of your tables structure for further details on JOIN.
Featured Poster
Reputation Points: 665
Solved Threads: 427
Posting Genius
debasisdas is offline Offline
6,406 posts
since Feb 2007
Sep 27th, 2007
0

Re: Joining two tables in VB 6

lets say from Customer Table I have CustCode, CustName, CustAdd, CustTel. from my OrderList I have CustCode, PONum, ItemName, QTY, Amt.

I want to get all the records that my customer bought. e.i. customer bought 5 items. the other day he bought 10 items. how can i use sql to join two tables to be able to show the record which my customer bought (the 10 items). what should i do. is there any changes to my table structure for this..kindly post your suggestion please...
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jhowell is offline Offline
4 posts
since Sep 2007
Sep 27th, 2007
0

Re: Joining two tables in VB 6

lets say from Customer Table I have CustCode, CustName, CustAdd, CustTel. from my OrderList I have CustCode, PONum, ItemName, QTY, Amt.

I want to get all the records that my customer bought. e.i. customer bought 5 items. the other day he bought 10 items. how can i use sql to join two tables to be able to show the record which my customer bought (the 10 items). what should i do. is there any changes to my table structure for this..kindly post your suggestion please...
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jhowell is offline Offline
4 posts
since Sep 2007
Sep 27th, 2007
0

Re: Joining two tables in VB 6

Click to Expand / Collapse  Quote originally posted by jhowell ...
hi to everyone,
Im creating an application which it can show all records of the two tables in single form. its like costumerTable and OrderList. how can i show a record of specific costumer from costumertable together with his product order details from OrderList table. Supposed I have costumerNo field from my costumertable and also i have costumerNo field in my Orderlist table. I also wants to show the order details in datagrid view supposed costumer bought 5 items. can anyone help me find solution. any help we'll be appreciated. thanks
>>try to used Query...In mS access
Reputation Points: 10
Solved Threads: 0
Newbie Poster
leovicAustria is offline Offline
8 posts
since Sep 2007
Sep 28th, 2007
0

Re: Joining two tables in VB 6

this is the query:
"SELECT CustName, CustAdd, CustTel.,
PONum, ItemName, QTY, Amt.
FROM Customer
LEFT JOIN OrderList
USING (CustCode)
WHERE CustCode='*your input****' ";
Got it?
Hope it helps....
Reputation Points: 28
Solved Threads: 71
Posting Pro
ryan_vietnow is offline Offline
578 posts
since Aug 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: MS Access data retrieval problem
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: from list view to label





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC