Forums
This topic is locked
Database Linking
Posted 27 Jan 2002 20:41:33
1
has voted
27 Jan 2002 20:41:33 Tony Chronopoulos posted:
Hi guys..I'm having trouble displaying pictures that I have in my database. The problem, i think, is my database. But just incase, here's the story:
I created a a little database because I'm not really familar with creating db apps.
field 1: first name
field 2: last name
field 3: picture
I created a subfolder called "images" and I have pics named "pic_001, pic_002, pic_003" and so on. What would be the proper way of linking a picture to an Access Database?
In Ultradev, when I drag the fields into my table, field 1 & 2 are fine but field 3 displays this: "?/"
thanks in advance and sorry if my message is a little confusing (i'm not thinking, just typing.. ) hehe..
Tony
Replies
Replied 28 Jan 2002 02:20:14
28 Jan 2002 02:20:14 Owen Eastwick replied:
Either store the whole image source in the database picture field, like:
<img src="MyPictures/pic_001.gif" width="20" height="10">
you will then be able to drag the database field from the data bindings window directly on to the page and the image will display.
Or Store just the picture name in the database field, drag it to the page and modify it as follows:
From this:
<% = RecordsetName.Field.Item("PictureFieldName".value %>
To this:
<img src="MyPictures/<% = RecordsetName.Field.Item("PictureFieldName".value %>" width="20" height="10">
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
<img src="MyPictures/pic_001.gif" width="20" height="10">
you will then be able to drag the database field from the data bindings window directly on to the page and the image will display.
Or Store just the picture name in the database field, drag it to the page and modify it as follows:
From this:
<% = RecordsetName.Field.Item("PictureFieldName".value %>
To this:
<img src="MyPictures/<% = RecordsetName.Field.Item("PictureFieldName".value %>" width="20" height="10">
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Replied 30 Jan 2002 16:24:35
30 Jan 2002 16:24:35 Tony Chronopoulos replied:
Thank you for replying! <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
I tried it, and it works pretty good. I just have to figure out file uploading now! : ) hehe.. .how fun!
Tony
I tried it, and it works pretty good. I just have to figure out file uploading now! : ) hehe.. .how fun!
Tony
Replied 30 Jan 2002 21:17:21
30 Jan 2002 21:17:21 Anders F Eriksson replied:
I solved this with an employee database that did not have a picture field by naming the picture that goes with a record to <database primary key>.jpg. For example, if my primary key is a field named UserID, and my user ID is "AFE", the image would be named AFE.jpg.
Then to display the picture I put <img src="Images/<% = RecordsetName.Field.Item("UserID".value %>.jpg" width="20" height="10"> in the code.
Then to display the picture I put <img src="Images/<% = RecordsetName.Field.Item("UserID".value %>.jpg" width="20" height="10"> in the code.