p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

access thread: OLE Object Field


Message #1 by "George Oro" <george@c...> on Tue, 18 Jun 2002 18:10:11 +0400
Hi Guys,

I have a table tblEmployee with the above field as Photo. The records is only around 400+ but the size of my back-end db is growing
like hell even I run the compact and repair db. This is my code to insert the photo:
--------------------------------------------------
Private Sub cmdInsertPhoto_Click()
On Error GoTo Err_cmdInsertPhoto_Click

    Me.M21PHOTO.Enabled = True
    Me.M21PHOTO.Locked = False
    M21PHOTO.OLETypeAllowed = acOLEEmbedded
    M21PHOTO.Action = acOLEInsertObjDlg

Exit_cmdInsertPhoto_Click:
    Exit Sub

Err_cmdInsertPhoto_Click:
    MsgBox "Operation Canceled.", vbInformation, "Insert Photo"
    Resume Exit_cmdInsertPhoto_Click
End Sub
---------------------------------------------------

From the above code, the photo is Embedded I'm sure that's the reason why. As a test, I made a copy of my db_be and remove the above
field and run compact and repair, and the size reduce from 42MB to 15MB... WEY...

Now I want to change my code to just linked the photo, which I know how to do it. My question now is, changing my code make a big
difference or solve the problem and how about the existing photo? How can I change them to Linked? I can't ask the user to insert it
one by one again, they will kill me.

Really sometimes, wrong analysis killing you softly...


Please help guys...


Cheers,
George :(




Message #2 by "Derrick Flores" <Derrick_Flores@s...> on Tue, 18 Jun 2002 09:33:01 -0500
George,
   I ran into the same encounter with a parts database.  It only had 238 
records with pictures of each part and the table was over 500mb.  What I 
did to fixed the problem was:  since all of the pictures was named with 
the associate partnumber I and located on the Hard Drive, it was easy to 
just load in the picture into the ole field using the partnumber on the 
recordset only when the record is current and removing it when the record 
is not current using the form current event.  This really help out when 
compacting and loading the form since Access did not have to load all of 
the records in the table with the associate pictures.

Good luck
Derrick Flores
Sony Semiconductor
San Antonio, TX


>>> "George Oro" <george@c...> 06/18 9:10 AM >>>
Hi Guys,

I have a table tblEmployee with the above field as Photo. The records is 
only around 400+ but the size of my back-end db is growing
like hell even I run the compact and repair db. This is my code to insert 
the photo:
--------------------------------------------------
Private Sub cmdInsertPhoto_Click()
On Error GoTo Err_cmdInsertPhoto_Click

    Me.M21PHOTO.Enabled =3D True
    Me.M21PHOTO.Locked =3D False
    M21PHOTO.OLETypeAllowed =3D acOLEEmbedded
    M21PHOTO.Action =3D acOLEInsertObjDlg

Exit_cmdInsertPhoto_Click:
    Exit Sub

Err_cmdInsertPhoto_Click:
    MsgBox "Operation Canceled.", vbInformation, "Insert Photo"
    Resume Exit_cmdInsertPhoto_Click
End Sub
---------------------------------------------------

From the above code, the photo is Embedded I'm sure that's the reason why. 
As a test, I made a copy of my db_be and remove the above
field and run compact and repair, and the size reduce from 42MB to 15MB... 
WEY...

Now I want to change my code to just linked the photo, which I know how to 
do it. My question now is, changing my code make a big
difference or solve the problem and how about the existing photo? How can 
I change them to Linked? I can't ask the user to insert it
one by one again, they will kill me.

Really sometimes, wrong analysis killing you softly...


Please help guys...


Cheers,
George :(







  Return to Index