Wrox Programmer Forums
Access ASP Using ASP with Microsoft Access databases. For Access questions not specific to ASP, please use the Access forum. For more ASP forums, please see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access ASP 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
Old May 31st, 2005, 08:33 AM
Authorized User
Join Date: Jun 2003
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default Inserting data into 2 tables

I have 2 tables: Names, which contains an id, FirstName and LastName, and Address, which has a NameID, Address, City, State, and Zip fields. The NameID field needs to be the same as the id in the Names table.
When a user views my form for the first time, they need to enter all of their appropriate data then click an "Add" button. Can I add the data to both tables at the same time? If not, can I get the NameID without having to perform a query to get that id from the Names table?

Old August 1st, 2005, 09:01 AM
Registered User
Join Date: Oct 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

There are methods of how tables are created and linked that will allow you to populate/ delete the tables in a cascade fashion. Here is a link that can provide some insight.

I have a table setup in this manner on home server and when I add different data the key record only needs to be entered once. When I delete on that key record both tables go away.

I hope this will give you some ideas, assuming I understood the question.



Newlan's Truism:
    An "acceptable" level of unemployment means that the government
economist to whom it is acceptable still has a job.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting Data into Multiple Tables bfoley SQL Server ASP 1 January 3rd, 2008 12:28 AM
Inserting values from other tables TheAndruu SQL Language 7 May 27th, 2007 10:47 AM
Inserting data in multiple tables rohits PHP How-To 1 August 29th, 2006 11:32 PM
inserting into multiple tables cridley SQL Server 2000 1 January 25th, 2005 12:05 PM
inserting into joined tables cjennings SQL Server 2000 3 July 23rd, 2003 06:10 AM

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