Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please help with the correct syntax to retrieve a picture file 1

Status
Not open for further replies.

vamoose

Programmer
Oct 16, 2005
320
0
0
MX
I am using FrontPage 2002 and MSSql 2000.

I am storing the following value: images/71A2030500D.jpg in a Sql column named: Image and retrieving it using the code: <%=FP_FieldLink(fp_rs,"Image")%> This works fine.

I would like to store the following value: 71A2030500D in a Sql column named: Image and retrieve it using the code: <%=FP_FieldLink(fp_rs,Images/"Image".jpg)%> but the syntax is not correct. Can anyone please help me with the correct syntax ? Thank you very much.
 
Vamoose,

I use FP 2003 and 2002, and I have done exactly what you are doing, but your syntax is messed up because you are trying to rename the record source and you can't do that or FP will freak out (as it did).

<%=FP_FieldLink(fp_rs,"Image")%> Calls your fp_rs (Front Page Record Source) the field in your DB.

I would try what you have, but take of the file extension .jpg and see if that works. If not, I am afraid you may have to leave your DB the way it is. I have my DB's setup with the "image/" prefix in front of the file names in the fields.

Is there a specific reason you need to leave of the "image/" prefix?

Hope this helps.

DBigger
 
I have been searching the net for the past couple days now and this is what I have come up with. The reason I am trying to do this is because I want only the picture name stored in the SQL database, the prefix of "images/" and suffix of ".jpg" have been removed. This allows me to store only the text of "71A2030500D" in the SQL table column named "Image". I have found that the following code works quite well to assemble this text back together and display the correct picture.

images/<%=FP_FieldLink(fp_rs,"Image")%>.jpg

I truly hope this code will help someone out as you have all helped me. Thanks for your support. Have a STAR on me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top