Forums

This topic is locked

Insert into foreign key table

Posted 30 Apr 2004 04:58:35
1
has voted
30 Apr 2004 04:58:35 pits sasa posted:
Hello
I am developing an update page for populating a tableA . This TableA is having foreign keys to several look up tables. How do i make the update page so as to get the dropdowns from all those lookup tables. And also when i do the update it must update the tableA with values from the lookup tables. Any help or links appreciated

Replies

Replied 30 Apr 2004 13:27:24
30 Apr 2004 13:27:24 Vince Baker replied:
so just to clarify,

You are inserting into a table but on your form you have drop down menus that are populated from other tables?

If so, you must create recordsets on your page for each of the tables that are cgoing to populate the menus.

Then, insert the menu into your form and then click on the dynamic flash in the properties inspector for that menu and select your recordset. You have to choose the value and label for this menu. THe label is what the client will see and select, the value is actually what will be sent to your table a (your link id in this case).

Once you done all this use the update server behaviour as normal and voila!



Regards
Vince

Visit my home: www.chez-vince.com

VBScript | ASP | HTML | SQL | Oracle | Hosting
Replied 30 Apr 2004 20:05:11
30 Apr 2004 20:05:11 pits sasa replied:
vince thanks for yr reply.

Yes that is the case. But this is not an insert it is an update. I hope even if you did the update the method you outlined above should work. Correct ??

any way i will try and check it out.
Replied 01 May 2004 12:53:39
01 May 2004 12:53:39 Vince Baker replied:
Yes as you say, the update and insert work on the same principal.

Regards
Vince

Visit my home: www.chez-vince.com

VBScript | ASP | HTML | SQL | Oracle | Hosting
Replied 02 May 2004 00:10:48
02 May 2004 00:10:48 pits sasa replied:
Additionally i would like to put a search form, i would like that search form to land into my update page. Any example of the code will be of great help
Replied 02 May 2004 14:59:21
02 May 2004 14:59:21 Vince Baker replied:
When you say search, can you clarify what you will be searching on in the db...

For example, you could just have a page that lists all the items in tableA in a dropdown menu and then just pass the id along to the next page to filter your recordset to perform the update action.

Or, you could list all your items on a page and then add an update image (or just the word) next to each item, click on item and then pass the unique_ID to the update page...

What sort of site is it?

Regards
Vince

Visit my home: www.chez-vince.com

VBScript | ASP | HTML | SQL | Oracle | Hosting

Edited by - bakerv on 02 May 2004 15:00:11
Replied 03 May 2004 13:37:23
03 May 2004 13:37:23 pits sasa replied:
I will be searching on a primary key from a search form , let us say it searches for server name, then the page will find it and will land into an update page.
Replied 03 May 2004 13:50:19
03 May 2004 13:50:19 Vince Baker replied:
ok,

1. create a page called search.asp (or something like that)
2. create a recordset on that page that that gets the unique key and a description or name field (this is so when we create a dropdown menu, the user will be able to choose from the list based on the description or name field)
3. add a form to this page and insert a menu/list and a button. Change the name of the menu/list to the name of your unique id field.
4. Click on dynamic in properties with the menu/list selected.
5. Now choose the recordset and then select your unique id for the value.
6. select the name/description field for the label.
7. change the form properties (action = your edit page, change method to get)
8. Now on your edit page open the recordset that gets all the info to edit and filter the results by the name of your menu/list (filter field_name = url menu/list name)
9. finished.

Regards
Vince

Visit my home: www.chez-vince.com

VBScript | ASP | HTML | SQL | Oracle | Hosting

Reply to this topic