# Solved: Access 2007: OLE Objects and access restrictions



## maxx_eclipse (May 29, 2007)

Afternoon techies,

I've been having a few issues with Access 2007, and was wondering if anyone could help me or provide any suggestions on how to go about this. But first, I'll give a background to the whole database. My database consists of only one table, which will be used by my company to store a digital collection of all their business associates (I had chosen to use Access instead of the Outlook Business Manager because I have more experience with Access). I then created three queries based on the table, and then also made forms and reports for the queries. So that's pretty much the gist of it.

So, here are my problems:

1) I have also included an OLE object for pictures in the forms, but would like to inform the employees that certain specifications need to be met before the picture can be placed. My concern is whether someone will place a massive image and drastically increase the file size of the database. The idea is to put a picture specified to be 95x125 (roughly passport size) and also use a JPEG format, so that the overall size is <50kb. I initially thought of placing a default background image with the specifications written (Constraints.jpg), but I couldn't seem to get it to work. So my next thought was to incorporate a validation rule for the OLE object, but so far, I haven't had any luck on this. Any ideas?

2) The database will be shared over a server, so that all the employs can upload their business contact simultaneously and have all the details saved to the database. But now my idea is to create two versions of the database; one that is for the employees to use and upload their information, and the other for non-employees to use only as an interface and only search/print for information (basically no alternations are permitted).

I had two ideas of how this might work. Firstly, I thought about using only one interface, and using some sort of a user account access so that the employees are granted full access and use, while the 'user' account would just allow non-employees to view the information, as well as make searches and prints, but I have no idea on how to do this. Secondly, I thought about making a copy of the original database and changing the preferences of the second database to restrict data alteration. I had tried in several ways, but with no success. I initially tried to make an ACCDE file, but this only locked the database format and design. I then tried changing the properties of the form under the Data tab, but then when I previewed the form, nothing appeared, so that wasn't successful. Has anyone been successful in trying this before?

Thanks for your time and your help!

Eugenio.

My System:
Windows Vista Home Premium (32bit)
RAM 4GB
Microsoft Office Small Business Edition (Access is only a trial)


----------



## OBP (Mar 8, 2005)

Eugenio, I can help you with some of this, but not the Access 2007 part of it in reference to an ACCDE file as I do not have Access 2007 Installed.
I handle the OLE object in a different way by just storing the Path to them in the Table and then using VBA to refresh the Form OLE Frame with the correct jpg, (not JPEG as that can cause Access 2000-2003 problems).
As to having 2 versions of the database, that is not necessary if you use the older .MDB version of the database with Security Invoked as you can have as many security levels as you like in that version.


----------



## maxx_eclipse (May 29, 2007)

Hey, thanks a lot for the quick response. I'll have to try this later, I'm a bit busy now, but it seems simple to understand.

Thanks for your help! I'll let you know how it went asap.


----------



## OBP (Mar 8, 2005)

See this Thread

http://forums.techguy.org/business-applications/779813-solved-automatic-picture-access-2003-a.html

post #14 for an example database showing photos in jpg format. It also works well .bmp.


----------



## maxx_eclipse (May 29, 2007)

Thanks again, this proves to be very helpful.


----------



## maxx_eclipse (May 29, 2007)

OBP said:


> I handle the OLE object in a different way by just storing the Path to them in the Table and then using VBA to refresh the Form OLE Frame with the correct jpg, (not JPEG as that can cause Access 2000-2003 problems).


I'm not sure if it's my ignorance of Access or whether it's the new Access 2007 layout, but I can't seem to find what you're talking about. I looked around, but couldn't find anything pertaining to a path/link in the table form.

I also just found out that the new Access 2007 formats (.accdb, .accde, .accdc, .accdr) do not support user-level security, so it looks like I'm going to have to convert my database to a previous version of Access so that I can use it. I find this new version of Access so confusing. :S

But thanks again for your help!


----------



## OBP (Mar 8, 2005)

This is the code on the Camera Subform that loads the photos.

Private Sub Combo12_AfterUpdate()
Dim foldername As String, rs As Object
Set rs = CurrentDb.OpenRecordset("Photo Path")
foldername = rs![Photo Path]
rs.Close
Set rs = Nothing
If Not Me![Camera Model] = "" Or Not IsNull(Me![Camera Model]) Then
Me!Picture.Picture = foldername & Me![Camera Model] & ".jpg"
Else
Me!Picture.Picture = ""
End If
If Me.NewRecord Then Me.Parent.Camera = -1

End Sub

Private Sub Form_Current()
Dim foldername As String, rs As Object
Set rs = CurrentDb.OpenRecordset("Photo Path")
foldername = rs![Photo Path]
rs.Close
Set rs = Nothing
If Not Me![Camera Model] = "" Or Not IsNull(Me![Camera Model]) Then
Me!Picture.Picture = foldername & Me![Camera Model] & ".jpg"
Else
Me!Picture.Picture = ""
End If

End Sub


----------



## maxx_eclipse (May 29, 2007)

...I'm still blank. Where do I substitute the folder/file names? Any syntax I need to use correctly?

I'm just surprised that there is no easy function of doing this. I really don't have much experience in Visual Basic, only through the user-interface.


----------



## maxx_eclipse (May 29, 2007)

It's okay now.

I solved the issue with the background image. Instead of an OLE object, I used an attachment, and used the properties field to put a default image.


----------

