Urgent -

darkmastergyz

Registered User.
Local time
Today, 14:33
Joined
May 7, 2006
Messages
85
I have 2 tables right now. Here's how the work:

tbl1:
primary key | field1
eg.
1|song name|
2|song name2|

tbl2:
primary key (mostly meaningless) | ID (key to link to tbl1) | file

1|1| c:/test/hello.jpg
2|1| c:/test/hello2.jpg
3|1| c:/test/hello3.jpg
4|2| c:/test/hello4.jpg
5|2| c:/test/hello5.jpg

So, it's a one to many relation from tbl1 to tbl2.

Now, I just realized having a table relation is next to useless because it's not like a query, for example, I can't do tbl1![file], because they're not linked. Basically what I'm trying to do is allow users to upload multiple images for each song, and each one would add it to tbl2. The problem is I have a text box, with a ...button which brings up a file selection dialog, and writes it to the text box. If I have 4 files, I need it to generate 4 file boxes, with 4 buttons. I'm not sure how to do that.

Example of 1 text box & button
[ text box ] [...]

Any help would be surely appreciated.
 
Your saying you know it should be a one to many... But also say they are not related? In your first table, first give your PK (Primary Key) some meaningful name...eg... "SongID" In your Second table you will have your PK of.... PictureID, or whatever but also have a foreign key, "SongID" relate it one to many on SongID.
What it sounds like you are doing is linking a PK to another PK. Don't.
 

Users who are viewing this thread

Back
Top Bottom