Joining two tables in VB 6

Reply

Join Date: Sep 2007
Posts: 4
Reputation: jhowell is an unknown quantity at this point 
Solved Threads: 0
jhowell jhowell is offline Offline
Newbie Poster

Joining two tables in VB 6

 
0
  #1
Sep 23rd, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 189
Reputation: plusplus is an unknown quantity at this point 
Solved Threads: 16
plusplus plusplus is offline Offline
Junior Poster

Re: Joining two tables in VB 6

 
0
  #2
Sep 24th, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 2,080
Reputation: debasisdas will become famous soon enough debasisdas will become famous soon enough 
Solved Threads: 124
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Postaholic

Re: Joining two tables in VB 6

 
0
  #3
Sep 24th, 2007
Join both the tables using SQL command and display the output on grid.
Share your Knowledge.
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 561
Reputation: ryan_vietnow is an unknown quantity at this point 
Solved Threads: 71
ryan_vietnow's Avatar
ryan_vietnow ryan_vietnow is offline Offline
Posting Pro

Re: Joining two tables in VB 6

 
0
  #4
Sep 24th, 2007
Join the 2 tables by use of the LEFT JOIN command in SQL.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 4
Reputation: jhowell is an unknown quantity at this point 
Solved Threads: 0
jhowell jhowell is offline Offline
Newbie Poster

Re: Joining two tables in VB 6

 
0
  #5
Sep 24th, 2007
Originally Posted by debasisdas View Post
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
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 2,080
Reputation: debasisdas will become famous soon enough debasisdas will become famous soon enough 
Solved Threads: 124
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Postaholic

Re: Joining two tables in VB 6

 
0
  #6
Sep 25th, 2007
Kindly post both of your tables structure for further details on JOIN.
Share your Knowledge.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 4
Reputation: jhowell is an unknown quantity at this point 
Solved Threads: 0
jhowell jhowell is offline Offline
Newbie Poster

Re: Joining two tables in VB 6

 
0
  #7
Sep 27th, 2007
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...
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 4
Reputation: jhowell is an unknown quantity at this point 
Solved Threads: 0
jhowell jhowell is offline Offline
Newbie Poster

Re: Joining two tables in VB 6

 
0
  #8
Sep 27th, 2007
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...
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 8
Reputation: leovicAustria is an unknown quantity at this point 
Solved Threads: 0
leovicAustria leovicAustria is offline Offline
Newbie Poster

Re: Joining two tables in VB 6

 
0
  #9
Sep 27th, 2007
Originally Posted by jhowell View 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
>>try to used Query...In mS access
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 561
Reputation: ryan_vietnow is an unknown quantity at this point 
Solved Threads: 71
ryan_vietnow's Avatar
ryan_vietnow ryan_vietnow is offline Offline
Posting Pro

Re: Joining two tables in VB 6

 
0
  #10
Sep 28th, 2007
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....
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC