473,385 Members | 1,927 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Relational Linking to Images

Question:
How does one create a relational link to an image in Access? In other words, instead of an image control with a path of "C:/Database Folder/Images/image001.jpg", I want to be able to link to "./Images/image001.jpg"
Technical:
Tables:
tblIndex
numMapID (primary)
numXCoord
numYCoord
lnkMapPage
lnkMapThumb
tblProjPages
numPageID (primary)
numMapPageID
lnkProjPage
Relations
numMapID one to many numMapPageID
Forms:
frmTest (test form)
picTest (picture control)
Move Information:
Each Map Page can have any number of project pages attached to it, but only one original map page. The images are stored in fldImages. When, in the database, I make a form's image field Picture Property = "/fldImages/001.jpg" or "./fldImages/001.jpg" or "fldImages/001.jpg", it gives me a "file not found" error. The database is being developed on a PC and then being transfered to a server where I will not know what the actual path to file is and as such I either need to dynamically extract that information using the built in VB tools OR create a link to the picture that is relational to where the database is stored.
Mar 23 '07 #1
8 1660
Denburt
1,356 Expert 1GB
You can use this but this will also give you the database name at the end, you will want to modify it to fit your needs.

Application.CurrentProject.FullName
Mar 23 '07 #2
ADezii
8,834 Expert 8TB
Question:
How does one create a relational link to an image in Access? In other words, instead of an image control with a path of "C:/Database Folder/Images/image001.jpg", I want to be able to link to "./Images/image001.jpg"
Technical:
Tables:
tblIndex
numMapID (primary)
numXCoord
numYCoord
lnkMapPage
lnkMapThumb
tblProjPages
numPageID (primary)
numMapPageID
lnkProjPage
Relations
numMapID one to many numMapPageID
Forms:
frmTest (test form)
picTest (picture control)
Move Information:
Each Map Page can have any number of project pages attached to it, but only one original map page. The images are stored in fldImages. When, in the database, I make a form's image field Picture Property = "/fldImages/001.jpg" or "./fldImages/001.jpg" or "fldImages/001.jpg", it gives me a "file not found" error. The database is being developed on a PC and then being transfered to a server where I will not know what the actual path to file is and as such I either need to dynamically extract that information using the built in VB tools OR create a link to the picture that is relational to where the database is stored.
If this is just a Single User Database, why not simply create an Images Folder under any Folder you designate as the Folder location for the Database. Copy the Image Files into this Images Folder and use the following code to locate them:
Expand|Select|Wrap|Line Numbers
  1. Debug.Print CurrentProject.Path & "\Images\" & "Image_File.jpg"
Output:
Expand|Select|Wrap|Line Numbers
  1. C:\Documents and Settings\security\My Documents\Images\Image_File.jpg
Mar 23 '07 #3
Denburt
1,356 Expert 1GB
Sorry this is more what you asked for:

Application.CurrentProject.Path
Mar 23 '07 #4
Denburt
1,356 Expert 1GB
You got it ADezii.
Mar 23 '07 #5
Those both work. Once I figure out how I want the output generated I will decide on which one to use. Thank you both for the prompt replies!
Mar 23 '07 #6
Denburt
1,356 Expert 1GB
Anytime :)
Mar 23 '07 #7
ADezii
8,834 Expert 8TB
Those both work. Once I figure out how I want the output generated I will decide on which one to use. Thank you both for the prompt replies!
You're more than welcome.
Mar 23 '07 #8
ADezii
8,834 Expert 8TB
You got it ADezii.
Thank you, Sir.
Mar 23 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

27
by: Lee Phillips | last post by:
I believe it is universally accepted that decorating your website with images from someone else's, without permission, is rude and unethical, even if the images are in the public domain, because...
0
by: Olivier Jullian | last post by:
Hi, I'm new to .NET and am trying to take advantage of the object structure while accessing relational databases. I started a small project for managing "projects". Here is a description of...
1
by: bab | last post by:
i need help linking my relational data base. some one help me please. i can link a one to one relationship but i cant link a one to many for some unknown reason. can some one please tell me how to...
5
by: chrisse_2 | last post by:
Hi, All the records in my database will contain at least one picture. At the moment all the images are part of the database as ole objects although the database is way to big and there is only...
3
by: meyvn77 | last post by:
Hello - I am looking for the best way to store images in a Access DB. My Idea - I have a table with 150,000 records. These recoreds represent a Crash (Traffic Accident). I have 50 different...
7
by: shahram.shirazi | last post by:
Hi all, This is a very stupid question, but it has been years since i've touched databases so any help will be very appreciated. I am designing a school registration database which also serves...
3
by: najimou | last post by:
Hi everyone I will be having a split database, running on 2 computers via mapped drive. computer "A" will have one front end and the back end located in c: \mydatabse 2 tables have links to...
3
by: shardy | last post by:
Hello, I am trying to create a code repository for myself and am having trouble linking to files. Basically, the web server computer has drives from several other computers nfs mounted to it --...
4
by: naveenmurthy | last post by:
Hello All, I have created a .mht file in following format. 1. The .mht file contains following htmls. a. MHTLinkingProblem.html b. Left.html c. Right.html d. Start.html
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.