Get ready for BLACK FRIDAY shopping starting in

Forums

ASP

This topic is locked

Drop down list from database

Posted 07 Nov 2004 21:31:53
1
has voted
07 Nov 2004 21:31:53 Jens Jakobsen posted:
Hi all.

I'm hoping that someone can help me. I'm building a form (ASP & MS Access 2000) where I've created a table called NEWS and another table called CATEGORY. Now the INSERT form works perfectly fine - I've created a recordset that points to the table called CATEGORY so that I can choose what category for my article.

However - my UPDATE form is quite another story.... Somehow I can't get the friggin' drop down to show the CATEGORY I chose when I wrote my article.

I've created 2 recordsets - 1 for the table that contains the article (NEWS) and of course 1 for the category (CATEGORY).

In the DYNAMIC LIST/MENU dialogebox I chose the following:

Options from recordset -> CATEGORY
Values -> CATEGORY
Labels -> CATEGORY
Select value equal to -> NEWS (the value reflected in the table NEWS)

Does this make sense to any one?

Replies

Replied 08 Nov 2004 12:25:54
08 Nov 2004 12:25:54 Simon Martin replied:
Hi Jens,

if you test the recordset for your article (NEWS) does it give you the foreign key for the CATEGORY table - i.e. has the relationship been created correctly?

Sharing knowledge saves valuable time!

Simon

[DWMX 2004]|[SQL]|[ASP/VBScript]|[XP-Pro]
Replied 08 Nov 2004 13:08:13
08 Nov 2004 13:08:13 Jens Jakobsen replied:
Actually no - so you say that I should do a JOIN in my SELECT statement?
Replied 08 Nov 2004 13:23:35
08 Nov 2004 13:23:35 Simon Martin replied:
When the initial article is INSERTED the values from your CATEGORY recordset should be stored in the NEWS table as a foreign key. So if you have a category "recent events" and its ID is 45 then in the NEWS table i would expect to see 45 to indicate it falls into the category of recent events.

If you are not getting the correct value from the database then it sounds like the INSERT is to blame, i.e. the relationship between the news article and the category is not being created. In this case the UPDATE may well be correct.
Check to see what you are INSERTING for the CATEGORY id

Sharing knowledge saves valuable time!

Simon

[DWMX 2004]|[SQL]|[ASP/VBScript]|[XP-Pro]
Replied 10 Nov 2004 12:50:06
10 Nov 2004 12:50:06 Jens Jakobsen replied:
I'll look into it this weekend - thanx for your time.

Reply to this topic