Results 1 to 3 of 3
  1. #1
    bnnook is offline Novice
    Windows XP Access 97
    Join Date
    Mar 2011
    Posts
    3

    Acc97 and OLE objects

    I wan't to do something like




    Sub MyProc()
    Dim strPath As String
    Dim db As Database
    Set db = OpenDatabase("db2.mdb")
    Dim rs As Recordset
    Set rs = db.OpenRecordset("test01", dbOpenDynaset)
    Do While Not rs.EOF
    strPath = rs("path")
    ' ole
    [OLEPath] = strPath
    [OLEFile].Class = [OLEClass]
    [OLEFile].OLETypeAllowed = acOLEEmbedded
    [OLEFile].SourceDoc = [OLEPath]
    [OLEFile].Action = acOLECreateEmbed

    rs.MoveNext
    Loop
    End Sub

    The test01 table looks like:

    Path OLEObject
    c:/test/1.jpg
    c:/test/2.jpg

    And the filed OLEObject is an OLE field. We want to embed the photos in the OLE field


    But it says external name not defined, meaning the OLEPath. I guess OLEPath only works for a newer version of Access? I'm using access 97.

    We got a bunch of photos to embedd and it sure would be nice to find a coding solution.

    Is there a way to do this in 97?

  2. #2
    SteveF is offline Generally AccessAble
    Windows XP Access 2010 32bit
    Join Date
    Nov 2010
    Location
    Fourth Corner
    Posts
    123
    If I recall, Access 97 wasn't too happy about embedding objects.

    As an alternative, you can store the path/link to the image you want to display, and build a form that uses an image-viewing control to show the linked file. One advantage of this is that it will noticeably keep your Access mdb file size a lot smaller than if you embed things.

    It's been too many years since I built exactly what I'm discussing here in Access 97 to recommend a specific image-viewing control; they are very often operating-system dependent. If you can't easily find one, post back in a new thread & see if anyone can assist there.

    Steve

  3. #3
    Max D's Avatar
    Max D is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2009
    Posts
    63
    Yep, using OLE embedding will blow your database quickly, because when you embed JPG file, Windows saves uncompressed bitmap of it along with original file.

    Try AccessImagine - its told to be the best image solution, especially for Access 97, that have very poor imaging options.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Problem with cyrillic objects
    By ttitto in forum Programming
    Replies: 0
    Last Post: 07-05-2010, 12:33 PM
  2. Access2007 databound objects
    By greg_brockman in forum Programming
    Replies: 3
    Last Post: 04-04-2010, 06:12 PM
  3. Referring to objects
    By stubbly in forum Programming
    Replies: 1
    Last Post: 10-14-2009, 09:36 AM
  4. query objects in VB6
    By genesis in forum Access
    Replies: 1
    Last Post: 07-10-2009, 02:16 AM
  5. All Access Objects shows nothing
    By Viwadd in forum Access
    Replies: 5
    Last Post: 05-29-2009, 02:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums