Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

OLE Object data is unusually large

2 posts in Objects Last posting was on 2009-06-04 22:22:40.0Z
Leonard Berman Posted on 2009-06-04 18:11:44.0Z
From: "Leonard Berman" <leonard.berman@surecomp-usa.com>
Newsgroups: sybase.public.powerbuilder.objects
Subject: OLE Object data is unusually large
Lines: 71
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4a280e60$1@forums-1-dub>
Date: 4 Jun 2009 11:11:44 -0700
X-Trace: forums-1-dub 1244139104 10.22.241.152 (4 Jun 2009 11:11:44 -0700)
X-Original-Trace: 4 Jun 2009 11:11:44 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9851
Article PK: 736984

Hi,



We have a PowerBuilder 9 application which uses OLE functionality to display
and store document images. It would appear that the software technique that
the application uses with respect to this OLE functionality leads to storage
of unnecessarily large amounts of data.



We have inserted a bit-map image OLE control (named ole20) on a window. We
use this OLE control to display and store the images.



Blob lblob



ll_fileLength = FileLength( ls_fileName)

ole20.InsertFile( ls_fileName)

lblob = ole20.objectdata

ll_blobLength = Len( lblob)



The software stores the OLE object data "lblob" in the database.



I have a .PDF file whose size is 206KB. When I execute the above code, the
value of ll_fileLength is 210,900 bytes while the value of ll_blobLength
is1,681,920 bytes. Why is the size of the OLE object data nearly 8 times the
size of the actual data?



If, instead of ole20.InsertFile( ls_fileName), we use the function
ole20.LinkTo( ls_filename), the size of the OLE object data is 1,469,440.
Again, why is the size of the OLE object data nearly 7 times the size of the
actual data?



It seems the reason that we store the OLE object in the database for ease of
display only. An obvious work-around would be to create the OLE object only
when we need to display the file image. Instead of storing the OLE object
data in the database, we would store only the actual data for the embed
option or the full path of the file for the link to option.



Are we using the PowerBuilder OLE functionality correctly? If not, what
should we do differently? Is the work-around that I suggested the optimal
work-around?



Thank you.



Leonard Berman


Bruce Armstrong Posted on 2009-06-04 22:22:40.0Z
From: Bruce Armstrong <NOCANSPAM_bruce.armstrong@yahoo.com>
Newsgroups: sybase.public.powerbuilder.objects
Subject: Re: OLE Object data is unusually large
Reply-To: NOCANSPAM_bruce.armstrong@yahoo.com
Message-ID: <tthg25pai7ecb5sttin8b1ugqf8loilk30@4ax.com>
References: <4a280e60$1@forums-1-dub>
X-Newsreader: Forte Agent 5.00/32.1171
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Date: 4 Jun 2009 15:22:40 -0700
X-Trace: forums-1-dub 1244154160 10.22.241.152 (4 Jun 2009 15:22:40 -0700)
X-Original-Trace: 4 Jun 2009 15:22:40 -0700, vip152.sybase.com
Lines: 95
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.objects:9852
Article PK: 736979

An OLE control puts the data into a compound file binary format, which
in many cases includes a rendered image of the underlying object for
preview purposes. The amount of extra data added varies by document
type and is determined by the application that does the packaging, not
by PowerBuilder:

http://en.wikipedia.org/wiki/Compound_File_Binary_Format

I would recommend storing the actual document, and then reading it and
inserting it into an OLE control at runtime.

On 4 Jun 2009 11:11:44 -0700, "Leonard Berman"

<leonard.berman@surecomp-usa.com> wrote:

>Hi,
>
>
>
>We have a PowerBuilder 9 application which uses OLE functionality to display
>and store document images. It would appear that the software technique that
>the application uses with respect to this OLE functionality leads to storage
>of unnecessarily large amounts of data.
>
>
>
>We have inserted a bit-map image OLE control (named ole20) on a window. We
>use this OLE control to display and store the images.
>
>
>
>Blob lblob
>
>
>
>ll_fileLength = FileLength( ls_fileName)
>
>ole20.InsertFile( ls_fileName)
>
>lblob = ole20.objectdata
>
>ll_blobLength = Len( lblob)
>
>
>
>The software stores the OLE object data "lblob" in the database.
>
>
>
>I have a .PDF file whose size is 206KB. When I execute the above code, the
>value of ll_fileLength is 210,900 bytes while the value of ll_blobLength
>is1,681,920 bytes. Why is the size of the OLE object data nearly 8 times the
>size of the actual data?
>
>
>
>If, instead of ole20.InsertFile( ls_fileName), we use the function
>ole20.LinkTo( ls_filename), the size of the OLE object data is 1,469,440.
>Again, why is the size of the OLE object data nearly 7 times the size of the
>actual data?
>
>
>
>It seems the reason that we store the OLE object in the database for ease of
>display only. An obvious work-around would be to create the OLE object only
>when we need to display the file image. Instead of storing the OLE object
>data in the database, we would store only the actual data for the embed
>option or the full path of the file for the link to option.
>
>
>
>Are we using the PowerBuilder OLE functionality correctly? If not, what
>should we do differently? Is the work-around that I suggested the optimal
>work-around?
>
>
>
>Thank you.
>
>
>
>Leonard Berman
>
>
>

-----------------------------------

My Web 2.0 Stuff

Blog: http://bruce.pbdjmagazine.com/
Facebook: http://www.facebook.com/people/Bruce-Armstrong/1600223798
Fotki: http://public.fotki.com/brucearmstrong/
LinkedIn: http://www.linkedin.com/in/bruceaarmstrong
Twitter: http://twitter.com/bruce_armstrong
YouTube: http://www.youtube.com/user/brucearmstrong