Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old February 4th, 2008, 05:09 AM
Authorized User
 
Join Date: Jul 2006
Location: dera ismail khan, nwfp, Pakistan.
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to naveed77 Send a message via Yahoo to naveed77
Default database query problem

dear friends,

i m using a database of two tables related wid each other by one to many relationship. i want to save and retrieve da data from dese two tables. e.g

t1 is table whose primary key is working as foriegn key in t2 table.
primary key is NIC. on the basis of dis field i want to save da data in table t2, and also want to retrieve it in the similar fashion.

but i dont know wat will be the right query to save and retrieve da data, i am using ADO and access database.
please solve the problem thnq
  #2 (permalink)  
Old February 4th, 2008, 05:39 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

What do you mean you want to "save the data in table 2?"
You want to insert data into table 2?
If that is the case, you can, with a recordset, use the .Add method, then set each field to the value for the new record, setting the field that erlates back to table 1 to the value for NIC of the record you want to relate to.
  #3 (permalink)  
Old February 12th, 2008, 06:47 AM
Authorized User
 
Join Date: Jul 2006
Location: dera ismail khan, nwfp, Pakistan.
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to naveed77 Send a message via Yahoo to naveed77
Default

dear friend, i could not understand it, i want to store da data in the both table using one query under save button and retrieve as well from both tables using one query. plz tell me right query

thanq in advance


Similar Threads
Thread Thread Starter Forum Replies Last Post
database related query dkvaseeta Pro VB Databases 2 February 22nd, 2007 10:59 AM
Database Query Question kbuska BOOK: Beginning ASP 3.0 4 September 23rd, 2004 11:04 PM
Problem with my database query jmurrayhead Classic ASP Databases 2 March 12th, 2004 03:48 AM
Database access from java, INSERT query problem nitusincog BOOK: Beginning Java 2 1 July 21st, 2003 10:26 AM
database query Darren JSP Basics 0 July 12th, 2003 03:57 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.