I don't really know if that would be hard for someone who is not too used to do that sort of things, but I suppose one can find a lot of tutorials though.
As for the images, I would store them directly in the database.
Assuming a soldier can have zero, one or more attachment and that an attachment belongs to one soldier (and only one), the basic idea is that you would have a Soldier table and an attachment table.
- Code: Select all
Soldiers table description:
id (primary key auto increment), first name, lastname, service_number, etc.
- Code: Select all
attachments table description:
id (primary key auto increment), soldier_foreign_key, attachment_name, attachment_binary_data, attachment_type, etc
Example for a two soldiers table:
- Code: Select all
soldier:
0, John, Doe, 123456, etc
1, Foo, Bar, 456789, etc
- Code: Select all
attachments:
0, 0, "Attestation Paperwork", xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, "image/jpg", etc
1, 0, "Copies of the Medal Roll #1", xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, "image/jpg", etc
2, 0, "Copies of the Medal Roll #2", xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, "image/jpg", etc
3, 0, "Copies of the Medal Roll #3", xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, "image/jpg", etc
4, 0, "Attestation Paperwork", xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, "image/jpg", etc
5, 0, "Other Paperwork", xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, "image/jpg", etc
6, 1, "Attestation Paperwork", xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, "image/jpg", etc
7, 1, "Copies of Medal index card", xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, "image/jpg", etc
(xxxxxxx represents here the binary data, just don't pay attention to that)
Remember the first column of the attachment table is just a unique ID for each table records (each line), here it doesn't serve any purpose for the attachment table.
The second column is a foreign key referring to the soldier table unique IDs.
See, the first attachment batch from 0 to 5 belong to John Doe who has the 0 id in the table soldier.
And of course, the last two attachment (6-7) belong to Foo Bar.
Now that you get the idea, the SQL (structured query language) to retrieve the attachments from a soldier would be as simple as the following:
- Code: Select all
SELECT * FROM attachments WHERE soldier_foreign_key=0;
(or soldier_foreign_key=1 if you want the attachments belonging to the soldier 1 who is Foo Bar, etc)
I don't know if that makes sense to you but I hope if helps a bit!
(I think access tends to (try to) hide those details but I am not too sure so don't worry too much)