|
-
September 28th, 2001, 09:26 PM
#1
Update same field in multiple table
I need to design an database which has five tables. I would appreciate if anyone can let me know how to perform this function:
when I click on update in one table, the same field which also locates on other table has to be updated as well... how do I do that ?
Please help !!!!!
THANK YOU !!!!
-
September 28th, 2001, 09:56 PM
#2
Re: Update same field in multiple table
Two observations:
1. The best method to do this may depend on which database you are using. Does your database have triggers?
2. If you have a field that needs to stay synchronized across five different tables, then your database is not normalized. The solution may be a better database design. My gut feeling is a database that has this design will be a problem to maintain.
-
September 29th, 2001, 02:56 AM
#3
Re: Update same field in multiple table
Thank you for your advice. My database has five forms which one primary key can be a secondary key to another form. This is supposed to be my assignment and I have to no way to alter the design coz I just open the database with the VisData Add-In and has to think about how to update the record in different tables on my own.
I am a real beginner, so I don't know what is a 'trigger'.
Thank you anyway.
-
September 29th, 2001, 11:02 AM
#4
Re: Update same field in multiple table
In some databases (SQL Server, Oracle, DB2, etc.) you can specify a piece of code called a trigger that will run whenever an specific event (insert, update, delete, select) happens to a table. You would write an update trigger for each table that would update the other four tables each time a record was changed.
As to your original problem, whenever any one of the tables is updated I would just go ahead and submit an update query against the other four tables for the one field you want to keep in sync.
-
September 30th, 2001, 03:10 AM
#5
Re: Update same field in multiple table
i can suggest you a way .ido not know if this is suitable but it works.
what you do is dim ado.recordsets and connect to those databases and update the fields you disire by update statements.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|