Solved

"OLE Object" in "Bound Object Frame" when Set to Zoom or Clip on a Form Causes Font to Display Very Small / Tiny Intermittently

Posted on 2006-06-08
10
2,041 Views
Last Modified: 2013-12-03
I have an Access 2000 database which consists of a datatable with several hundred records.  Then I have a form which displays the records from the datatable with some nice borders and stuff.  The database has three fields: "serial number," "name," and "PDF file."  I only just recently added the "PDF file" field to the database.  It is set as an OLE object in the datatable.  And it is pulled onto the form as a "bound object frame."

My problem is, whenever I'm looking at the records (or a subset of the records) from the form, if there are embeded PDF files in any of the records showing on the rows, and I click on refresh, then the font on the records drops down to teeny-winy.  After much experimentation, it turns out that this is intimately connected with the OLE object.  I've set the format of the OLE object being pulled to the form to display as and icon.  So I see a miniature Adobe Acrobat icon on that "PDF file" object on the form.  I've set the "size mode" to Zoom (I've also tried Stretch).  Whatever size that Access needs to zoom the icon down to make it fit in the control on the form, is what size the the font is on the rest of the records (intermittently).

I can consistently cause this behavior by clicking on RECORDS > REFRESH.  The behavior goes away if there are no records showing on the form with PDF files embeded.  The problem goes away if I hide the PDF file control on the form.  The problem goes away if I set the "size mode" on the control to CLIP (both ZOOM and STRETCH) cause this misbehavior.

Anyone ever run accross this?  Anyone know how I can get around this?  Please no visual basic coding because I am totally illiterate in that.

Thanx in advance.
0
Comment
Question by:kirk0820
  • 4
  • 3
  • 3
10 Comments
 
LVL 58

Expert Comment

by:harfang
Comment Utility
Hello kirk0820

I did run some tests (Access 2000 SP3), but I was unable to reproduct this behavior. If you look at your table, what does the PDF file field show? "Package"? Also, when you insert the files, do you choose "Link to file"? or "Display as Icon"?

This is really one more to add to the list of "why *not* to use OLE objects in Access". I've never seen a working application using them, save for tiny bitmaps.

You probably should only store the path to the file in your database, but then the interface would require a little VB code to be useable. Not much, perhaps, but still.

Sorry I couldn't help.
(°v°)
0
 
LVL 38

Expert Comment

by:puppydogbuddy
Comment Utility
It depends on the method (out of 3) chosen to store the image and on the method chosen to display the image.  There are tradeoffs to each.

see these links:

http://jamiessoftware.tk/

http://www.ammara.com/articles/accesspictureole.html

http://office.microsoft.com/en-us/assistance/HP052802251033.aspx

http://office.microsoft.com/en-ca/assistance/ha011472041033.aspx

Re:size mode
After you add the image to the form, click the SizeMode property and select one of the following values. Setting Description
Clip Displays the picture at actual size. If the picture is larger than your form window, Access cuts off the image.
Stretch Sizes the picture to fit the form window. This setting may distort the image.
Zoom Maintains the correct proportionality of the image regardless of how you size the from. This setting won't clip the picture or distort its proportions.
0
 
LVL 38

Expert Comment

by:puppydogbuddy
Comment Utility
As to speccifically what is causing the distortion in your casee, it may be that your objects are not sized properly for your screen resolution.  See this link for a free form resizer with a developers license.

http://jamiessoftware.tk/
0
 

Author Comment

by:kirk0820
Comment Utility
HARFANG:  thanx a meg for testing this out for me (and sorry for the delay in replying).  I actually stumbled across something that seemed to rectify the problem I described.  If I set the bound object frame on the form so that it is "sent to back” (as opposed to “bring to front”), then the problem with the font size intermittently going really tiny goes away.

By the way, I also realized later that if I set the bound object frame (which is pulling and OLE object from the datatable) to a really large size, then the font could intermittently go really huge on the font in the surrounding records.

To answer your questions, the PDF object on the form shows a PDF icon (the same icon as you’d see if you had a PDF file on your desktop) with the words “Acrobat Document” below.  Since the control on the form is small and set to zoom, the PDF icon is very tiny, and the text is below the icon is actually usually cut in half and clipped at the edges.

I am dragging and dropping the PDF files into the records showing on the form.  So I am embedding the files into the database.

I’m really interested in your point about the inadvisability of using OLE with Access.  I see from PuppyDogBuddy’s comments below that there can be lots of pitfalls with this, but these seem to stem from not having the right “server” application on the end user machine.  All of my users have Access 2000 and Adobe Acrobat Reader on their machines.  In your opinion, is there still significant potential for the disconnect to occur with this embedding technique?  More importantly, is there some additional risk with the Access database becoming corrupted that you know of when embedding files into it?  I had the greatest difficulty when I was first building this database a couple years ago with the whole thing becoming corrupted several times.  After much trial, error and experimentation, I ended up making the database an .MDE (compiled?) file to finally resolve the corruption.



PUPPYDOGBUDDY:  thanx so much for the very useful links and information regarding OLE.  It was very helpful and got me to understand a little more about what is going on behind the scenes.  As you know, I’m embedding Acrobat files into the records in my database, not images.  However, after reading through the articles you pointed me to, it almost seems to me as if the two things are very analogous.  Both of them involve “invoking” an external application to handle display of the embedded file object.

Let me ask you the same questions as I did Harfang above?  All of my users have Access 2000 and Adobe Acrobat Reader on their machines.  In your opinion, is there significant potential for the disconnect between Access / Acrobat to occur using this embedding technique?  More importantly, now that I’m embedding files into this database, is there some additional risk with it becoming corrupted that you know of?  I had the greatest difficulty when I was first building this database a couple years ago with the whole thing becoming corrupted several times.  After much trial, error, and experimentation, I ended up making the database an .MDE (compiled?) file to finally resolve the corruption.

Thanx in advance.
0
 
LVL 58

Expert Comment

by:harfang
Comment Utility
kirk0820,

Obviously, if all your users have the same versions of Access and Acrobat Reader installed, you should not encounter as many problems, and perhaps even none at all.

However, I never understood the benefits of using OLE. It has always seemed so much simpler to me to store only the file names and manage a folder with the documents on the side. This reduces the database size, leaves the documents available for other uses, makes it easy to copy, download, e-mail and otherwise access the information.

This requires some programming to get a smooth interface, but nothing really complex.

Using OLE however, you start up with no programming, which sounds awfully good, but as soon as you have the slightest special need, you will need quite heavy programming. Nothing easy about manipulating OLE objects in a table.

The one thing that really stopped me short: drag a file to an OLE control. You can look at it, perhaps edit it, all is well. Now ask Access to save the file to a new location.... CAN'T DO! You actually need to open the server application and use "save as" or the like. I really cannot see the point in embedding a file if Access is not even capable of taking it out again.

Success with your application!

(°v°)
0
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 
LVL 38

Expert Comment

by:puppydogbuddy
Comment Utility
Kirk,
The only thing I can add to Harfang's comment is that there is a third party image control for Access (see the link) that is supposed to overcome most of the OLE limitations mentioned by Harfang.  If you are serious about storing images in an Access database, I would investigate this product further.  They allow you to download a functional evaluation version.  

                              http://www.ammara.com/start/index-aw1.html?campaignid=2959608&adgroupid=456744588&creativeid=1492213578
0
 

Author Comment

by:kirk0820
Comment Utility
PUPPYDOGBUDDY:  I looked at the DBPix link you sent me.  It seems to only apply to "images" being stored in an Access database, but not applicable to the Adobe Acrobat files which I'm trying to store.  Also, I get the impression from their web-site that this "add-in" should ideally be installed on every client machine that is using the database?

By the way, I've had a further development with my project.  Wouldn't you know it - as soon as I started testing out this database with other computers, I ran into a couple of problems.  It works very well....except that when I test it out on a machine with the latest Acrobat (7.0) reader installed, I get an error message:  "The operation on the Acrobat Document object failed... the OLE server may not be registered... to register the OLE server, reinstall it."  Or, if they have Acrobat 7 (full), it works fine, except, it tries to force the control on the form in Access to show the contents (as opposed to showing an icon).  But since the database is read-only for these other users, that creates a conflict and they seemingly get stuck.  In reality, there's a message on the status bar which says something to the effect that the record cannot be updated, and hitting escape gets around this.


HARFANG:  I'm being lazy here.  But I tried experimenting by setting my Access database so that the control on the form which stores the PDF would only accept "linked" files.  I right-clicked on the bound object control and went to DATA then OLE TYPE ALLOWED and set it to "Linked" only.  However, when I scan a file and create a PDF on my desktop, then drag that PDF file onto the control on the records in the database, it still embeds the file.  I even tried creating a simple database from scratch and setting the relevant control on the form to allow "linked" only.  However, it still embeds the file by default.  Please bear in mind, I'm endeavoring to make this as simple as possible for the users, because I will have about 5 people who will be maintaining this thing (and many more who will have read access).

But another question, even if I could somehow lock it down so that the form only allowed linked PDF files, then would that have any amelioration on the problems I'm having with some users' Acrobat 7 causing slight misbehavior?

I wasn't quite sure what to make of it when you said you were really stopped short regarding the dragging and dropping of files into Access.  Was that a "bad" thing?

Again, thanx much for all the help provided.
0
 
LVL 58

Accepted Solution

by:
harfang earned 500 total points
Comment Utility
kirk0820

Your experience confirms that of thausands of users: you cannot use OLE objects reliably. There are probably some workarounds available for the "OLE server not registered" error or the dozen other errors that occur as soon as you change computer or upgrads the "server application". But, believe me, they are very technical and involve at the very least reading (and writing) to the registry and/or creating automated push installations of software.

I have written the same thing in more words in {http:/Q_21829729.html#16821765}, about JPG images, but what I say there applies to PDF as well.

The "being stopped short" bit was not about dragging files. That is very desirable and I often wished to be able to implement that in my databases. What stopped me is that you can drag files *into* an OLE field, but that you cannot later just drag them *out*... Not only that, but "save as" is disabled, and the context menu does not offer it either.

Since you are using only linked files, have you tried creating a hyperlink field? They accept drag and drop operations as well, and will not show any of the problems you have experienced. The PDF extension would be handled differently depending on the file associations, regardless of version numbers. This is much more reliable, and – if you need to adjust things through code – much easier to manipulate.

Good luck!
(°v°)
0
 

Author Comment

by:kirk0820
Comment Utility
PUPPYDOG & HARFANG:  Again thanx much for all of the advice you've provided.  And again, sorry for my seeming procrastication on this question.  Actually, I've been working on it but I'm a relative novice, and so it takes me a while to get any kind of a grip on these new approaches.

HARFANG:  I've been trying to work with your suggestion to use controls that are set to "hyperlinks."  It's very promising in a lot of ways, but there are certain "problems" (from my point of view) which I can't seem to overcome (maybe they're insurmountable).

I don't want to wear out my welcome by asking you yet another series of questions along the lines of a hyperlink tutorial.  So if don't get a response back from you in the next day or so, I'll go ahead and assign point and close this question.

Then I'm probably going to submit a brand new question into the ExpertsExchange system.
0
 
LVL 58

Expert Comment

by:harfang
Comment Utility
kirk0820

If you choose to abandon the OLE approach, I will consider this question answered (^v^)

As for hyperlinks, I believe there is nothing that you did with linked OLE objects that you cannot do with hyperlinks, or even simple text fields for that matter. But this discussion is best left for a fresh question.

By creating a new question with an explicit title, you will attract other experts who's attention was not caught by OLE objects, for example. Anyway, this would be in line with the general practice at EE.

Cheers!
(°v°)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now