Forums
This topic is locked
Image Gallery from Access
Posted 26 Sep 2007 21:51:16
1
has voted
26 Sep 2007 21:51:16 Mark McElhone posted:
Hi,I am trying to create an image gallery where there is job name, job description and multiple images per job. At the minute there are 3 columns in the database: JobName, JobDesc and PicPath where PicPath just contains the name of the picture.
I also want the images to appear as thumbnails so that when they are clicked they will appear in a bigger window.
If there was only one image per job there wouldnt really be a problem. Its just that when there are multiple images I dont know what way to bring them through or even if the database is structured properly.
Any ideas?
Replies
Replied 30 Sep 2007 05:00:21
30 Sep 2007 05:00:21 Dan Berdusco replied:
Hi Mark,
You need to structure your database differently to allow a 1 to may relationship. This is how i would do it:
<b>Table 1</b> (this will store jobs)
jobID (autonumber)
jobName
jobDescription
<b>Table 2</b> (this will store multiple images for each job)
imageID (autonumber)
jobID (number)
picPath
The way it works, is you create one job entry in Table 1, and then there are multiple images stored in table 2 that relate to Table 1 using jobID...
Make sense???
You need to structure your database differently to allow a 1 to may relationship. This is how i would do it:
<b>Table 1</b> (this will store jobs)
jobID (autonumber)
jobName
jobDescription
<b>Table 2</b> (this will store multiple images for each job)
imageID (autonumber)
jobID (number)
picPath
The way it works, is you create one job entry in Table 1, and then there are multiple images stored in table 2 that relate to Table 1 using jobID...
Make sense???
Replied 30 Sep 2007 15:16:22
30 Sep 2007 15:16:22 Mark McElhone replied:
Hi Trevor,
makes perfect sense as kinda had it setup in that way before but wasnt working properly, obviosuly hadnt done it right. Not totally sure on drawing all the images from access though, would this be best achieved using a datalist and then repeat region?
Mark.
P.S. there are also 3 different categories that jobs can fall under, Category 1, Category 2, Category 3. SO I assume there should be jobCat in one of the tables?
Edited by - maximusimo on 30 Sep 2007 15:21:24
makes perfect sense as kinda had it setup in that way before but wasnt working properly, obviosuly hadnt done it right. Not totally sure on drawing all the images from access though, would this be best achieved using a datalist and then repeat region?
Mark.
P.S. there are also 3 different categories that jobs can fall under, Category 1, Category 2, Category 3. SO I assume there should be jobCat in one of the tables?
Edited by - maximusimo on 30 Sep 2007 15:21:24