July 31st, 2002, 12:11 PM
need help with Microsft Access 2000 db
Ok, Im working with an Microsoft Access 2000 database which I uploaded to my hosting server and I got it up and running to display from the database using ASP. Now I'm trying to add pictures to the database to view them online and this is where I'm running into problems. I can add the pictures as an OLE object to the Database browsing my harddrive but when I try to hardcode the online path, it tells me "this is file does not exsist", but the path I'm giving will be the path on my hosted server. Can anyone tell me how to add pictures and view them online?
July 31st, 2002, 04:26 PM
don't store the pictures in the database...and don't use ole. just have a field called path (text), and say where the path is on the server. then in your asp when you select a specific record you can just see what the path is and then use it in your ASP...for example:
say that the picture field for record 1 says (in plain text) images/pic.jpg
then your asp could have something like:
<img src="<% Response.Write rs("picture") %>">
July 31st, 2002, 06:06 PM
Thanks for your help but will this give me a link to the picture or will the picture be display when the page is served? I would like the picture to come up when the page is loaded. Will it?
August 1st, 2002, 09:15 AM
yes. think of it like this...if you have your directory structure like this:
public_html <--Root level
public_html/docs <--One level down
public_html/images <--One level down
then if you just had some static html residing in public_html that had some picture on it, then the code would look something like:
then when you use your ASP you are doing the same thing (except it is not static) by saying:
your picture will display the same as it would with a static page (assuming rs("picture") value equals "images/someimg.jpg".
August 1st, 2002, 10:49 AM
Thank you Tron you are a true Zen Master
August 15th, 2002, 12:01 PM
another thing you might want to do is in the database when you are entering the URL of the picture you might want to enter the backslash before the folder name as well......