Ole Object link address change? (1 Viewer)

sina

New member
Local time
Today, 12:44
Joined
Jun 30, 2009
Messages
2
Hi
I have a mdb file which I linked my pictures' addresses(paths) as an ole object for the picture field of my table instead of embeding them in, which could make my database huge.
Now the question is; how can I update the address of my pictures if I want to move the picture folder, of corse except manualy delete and insert new addresses. (in the data sheet view it says package and does not give me the address to update it)?
thank you
 

DCrake

Remembered
Local time
Today, 20:44
Joined
Jun 8, 2005
Messages
8,632
The fact that your datasheet view is saying Package as opposed to the path to the picture folder implies that your pictures are embedded. What version of Access are you using?

David
 

Simon_MT

Registered User.
Local time
Today, 20:44
Joined
Feb 26, 2007
Messages
2,177
I only put images onto proper forms not datasheets. The folder location can be handled first the Folder declared separately and then the actual image file and then concatenating the two.

Simon
 

sina

New member
Local time
Today, 12:44
Joined
Jun 30, 2009
Messages
2
hi
the version I used was 2003 and just recently I got 2007 and the pictures are not embeded and the mdb file is small, all the pictures are linked and in datasheet view it shows "package" .
what simon says is soemthing else, this is a database with 1000 records and each has a pic you should embed them all or link the pictures, the question is how we can update somehow the linked addresses so we can change the folder location on the network.
thx
Sina
 

Simon_MT

Registered User.
Local time
Today, 20:44
Joined
Feb 26, 2007
Messages
2,177
I have a database with over 16,000 images each reliant on a a unique record within the dataset. In a network enviornment the Images look at a network drive. In a standalone situation the Images are within the Database directory whilst the web instance Images are in the relevant section of inetpub. So I use a simple data variable to determine where to find the images.

Is this the type of thing you mean?

Simon
 

Shinta

Registered User.
Local time
Today, 13:44
Joined
Jan 11, 2012
Messages
48
Hello:

I've got the same issue related to the massive link edition of OLE packages which pictures are *not* embebed but rather located at a static path at the hard drive.

Any ssugestions?

Thanks a lot :)
 

Simon_MT

Registered User.
Local time
Today, 20:44
Joined
Feb 26, 2007
Messages
2,177
There are three steps:

One the path which I first store in a file and plant on the main menu

Code:
Function GetPictureDir() As String
    GetPictureDir = Forms![Menu]![Image Directory]
End Function

You can just specify the full path like

GetPictureDir = "C:\Images\"

Step Two involves queries

Here you specify the file name:

[ImageFile] = [StockID] & ".jpg"

Then these Functions
Code:
Function GetPicturePath()
    With CodeContextObject
        GetPicturePath = GetPictureDir & .[ImageFile]
    End With
End Function
Code:
Function GetPictureExist()
        If Dir(GetPicturePath) <> Empty Then
            GetPictureExist = -1
        Else
            GetPictureExist = 0
        End If
End Function
Code:
Function GetPicture()
    With CodeContextObject
        If GetPictureExist = True Then
            .[ImageControl].Visible = True
            .[ImageControl].Picture = GetPicturePath
        Else
            .[ImageControl].Visible = False
        End If
    End With
End Function

If you have Access 2007 providing you can concatenate the ImagePath and ImageFile you can create an Image Control and its Control Source becomes =[ImagePath] & [ImageFile]

Simon
 

Shinta

Registered User.
Local time
Today, 13:44
Joined
Jan 11, 2012
Messages
48
Hello Simon:

First of all, I wanted to thank you for the patience and interest in this particular, old and unsolved issue.

I've not had time to try out the suggestion and code that you've given, yet, I'll give my feedback as soon as I'm able to.

This is quite an "obscure" issue at Access, and it does not seem easy to find help about it [it all seems this is "dark side" of Access Programming: I'm sure that I'm not the first that lives this].. so, thanks a lot for the help! It's quite appreciated.

Regards,

Javier
 

Simon_MT

Registered User.
Local time
Today, 20:44
Joined
Feb 26, 2007
Messages
2,177
I don't see why it should be an enigma. Images are just an object the mistake Microsoft made was going down the bitmap route OLE and embedding images. All you need to do is associate the image to the file.

Simon
 

Shinta

Registered User.
Local time
Today, 13:44
Joined
Jan 11, 2012
Messages
48
Greetings:

Please forgive for my sooo late responce about this subject: I've just managed to get into this issue, again, until now. But well, I know that these stuff are not really of concern :)

mm... well, I've attached an example of ths situation I need to solve. In this file you will see a folder which cointains a sub-folder called "\prov" which would contain images related to clients based in their client ID (in this case, I've uploaded the images related to client#0002).

The logic I've followed is to insert a thumbnail at the form, which relates to a field at the clientsTbl (clientsTbl.photo); this field is an OLE type, which is a *.bmp with a link to a "physical" image (*.jpg).

So, my concern would be; how can I do that, with a command button at the form (in this case, the small-camera-button at the left of the #client field), I could load the images corresponding to this client? (that is, the *.bmp for the thumbnail -which is stored at the OLE field @ DB -, and the corresponding link to the *.jpg -which is a physical file at the HD-).

I believe that by knowing how to do this, it would be the base for doing it massively (which is a desire I've got).

Thanks a lot for considering helping me again with this subject, connecting your last responces with my specific concern.

Hope to know about you as soon as is possible to your own need.
Regards,

Javier
 

Attachments

  • PicMng.zip
    1.9 MB · Views: 169

Simon_MT

Registered User.
Local time
Today, 20:44
Joined
Feb 26, 2007
Messages
2,177
Sorry, for the tardy reply, I have being finishing a major project.

What are the four photos?

photo
sign
cred1
cred2

Could I have an example of each for record 2.

I have had a look at the Client Form and I don't see the point of putting these images on the form when they are so small. My Suggestiion is put one on the Form and access the other independently,

The method used just doesn't seem to work, not your fault, it hasn't worked since Access 1997.

Simon
 

Shinta

Registered User.
Local time
Today, 13:44
Joined
Jan 11, 2012
Messages
48
Hello Simon:

First of all, thanks *a lot* for re-considering this old thread... some people had me loose any hope I had for any help about here.. so, your interest is *really* appreciated :)

But well.. I try to do my best for explaining the situacion.

This portion of the system intends to show the clients general data and a thumbnail of his ID's. This implies 4 pictures as you mentioned:

photo
sign
full ID front-side
full ID back-side

Finally, the small pic (*.bmp), is loaded as a OLE file which, at the same time, is linked to the *real pic* (a *.jpg file with a static path).

...

So, if I understand you correctly (please tell me if so), your suggestion would be not to use this approach but rather... (I didn't get which was your suggestion).

If by any chance my approach is not that out of place, could you please help me to do a sub-procedure for loading the pics? By now I do it manually by doing all the process at the OLE linked pics (the one that works as the thumbnail and the "real" pic).

I hope to have made myself clear ..if not.. I will try again :)

Hope to hear from you later... my best regards for your will to help: it pretty appreciated :)


Javier
 
Last edited:

Simon_MT

Registered User.
Local time
Today, 20:44
Joined
Feb 26, 2007
Messages
2,177
Sorry,

I have been finishing off a big project.

This OLE issue has been raised several times. I have never been able to get it to work (since Access 1997), well that's a lie, I simply gave up on the idea and used another method.

There are two alternatives - some suggest using an attachment or referentially rendering the images. If you give me a database or the four images I will do it the later. You could try the attachment.

Simon
 

Shinta

Registered User.
Local time
Today, 13:44
Joined
Jan 11, 2012
Messages
48
Hello again Simon:

Thanks a lot for the quick reply; I've modified the AccessDB file so it shows all the context of this request (attached to this message). It contains:

+ A table with 2 registries (aka, 2 clients)
- The last 4 fields of the table are OLE objects, which are *.bmp files that functions as the thumbnails and, at the same time, they link to a "physical" (Hard Disk) *.jpg file, which is the full version of those images.

+ A form, which is linked to the table via a query. This form shows the *.
bmp thumbnail and, if you double click it, you can open the full version of the image via the default Window's image viewer installed.

By the way, there are two types of images (both, front and back):
* one for the driver license
* one for the official ID

The later was important to mention, as the nomenclature of the file would vary depending of the ID uploaded.

So, this is it.. please tell me if there are still obscure issues relating my request for your gentle help.

Thanks a lot... please take your time: I don't wish to "demand" help.. on the contrary, I appreciate it deeply.

Sincerily,

Javier
 

Attachments

  • clientsPics.zip
    1.5 MB · Views: 144

Simon_MT

Registered User.
Local time
Today, 20:44
Joined
Feb 26, 2007
Messages
2,177
Shinta,

The images could be a lot smaller - 72dpi and about 750 pixels is sufficient.

Naming conventions should be consistent

Drive & Drive1
ife & ife1

Drive1 & Drive2
ife1 & ife2

No Images need to be stored in the database, neither do they have to be added.

I have added the following fields

image_ref the name of the image file for cred1 & cred2

These indicate if an Image exists.
image_photo_flag
image_sign_flag
image_cred1_flag
image_cred2_flag

Added Picture Form
Added Modules

Simon
 

Attachments

  • Remisa.zip
    926.7 KB · Views: 120
Last edited:

Shinta

Registered User.
Local time
Today, 13:44
Joined
Jan 11, 2012
Messages
48
Hello Simon :)

Thanks a lot for the amazing reply!! .. I'll take the time to study and understand your approach. I'll give my feedback as soon as possible.. for what I've been able to see until know, it seems great!

Regards :)


Javier
 

Simon_MT

Registered User.
Local time
Today, 20:44
Joined
Feb 26, 2007
Messages
2,177
Javier,

Sorry a couple of things:

ClientsQry you need to change ImagePath

I have used C:\Databases\Remisa\Prov\

The same applies to the Module Pictures

Basically, you save the images first and then they will be associated with the record.

The directories for each image are not padded with "00" just the clientID.

Simon
 

Shinta

Registered User.
Local time
Today, 13:44
Joined
Jan 11, 2012
Messages
48
Hello Simon, nice to salute you once again :)

Thanks for your help and suggestions; I've finally implemented what I was looking for. I've done the following:

* Took the "hyperlink" property of the ImageControl, so it would let me do the "thumbnail -> physical file" effect that I was looking for.
* Thanks to the "zoom" property, I don't need any more the *.bmp file, as Access does it for me (so no image was needed to upload to the DB, as the OLE-file approach that was originally used).
* With a little bit of coding (nested "IIF"), I made the "000" nomenclature to work.

The only thing I'm still missing (not a great deal, but yet it will help improve my design), is that, if I evaluate a non existing physical file, Access shows a message to the user, not matter if I use DoCmd.Echo False, DoCmd.SetWarnings False, or not (this can be seen at the code behind the ClientsForm).

Perhaps this is unavoidable, yet I would like to know if there is something that could be done.

Thanks again!... I leave this new version attached so, if anyone in the future needs something like I did, could take advantage of it.

Regards,

Javier
 

Attachments

  • clientsPicsv2.zip
    801.6 KB · Views: 115
Last edited:

Simon_MT

Registered User.
Local time
Today, 20:44
Joined
Feb 26, 2007
Messages
2,177
Personally, I want to see decent images hence the Pictures Form. I deal with art and the works of art are initially on a subFrom from 1 - 100+ stock records for each artist so it is impracticable to hold the images on the Continuous Form.

Again padding out the zeros, nice bit of code, but it only means a difference to the directory structure,

I can not emulate the Error when does it happen.

The jpgs are so much more efficient, however there will be an overhead crunching down the images.

Simon
 

Users who are viewing this thread

Top Bottom