Results 1 to 8 of 8
  1. #1
    swas is offline Advanced Beginner
    Windows 10 Access 2013 32bit
    Join Date
    Apr 2017
    Posts
    32

    Can a db.property of dbLongBonary type be used for an image?

    Hello,



    Is it possible to store an image as a database property?

    Property type dbLongBinary seems to be for this, but not sure on usage.

    Example:
    obj.Properties.Append obj.CreateProperty("MyImageProperty", dbLongBinary, varMyImage)


    Thanks for any comments.

    swas

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,428
    a) have you tried it?
    b) why would you want to do it?

  3. #3
    swas is offline Advanced Beginner
    Windows 10 Access 2013 32bit
    Join Date
    Apr 2017
    Posts
    32
    Ajax,

    Thanks for the reply.

    Tried setting a property with an image stored in a table as an OLE type but errors out (Sorry don't have my normal Access where I am at the moment to get the error).

    I just need to store a company logo. I could store in a single record table, or a binary table for images. As a property seems its correct place for a one-off image.


    swas

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,428
    Don't think I would consider it a property since it is more of a 'thing', object/file/whatever.

  5. #5
    swas is offline Advanced Beginner
    Windows 10 Access 2013 32bit
    Join Date
    Apr 2017
    Posts
    32
    Thanks for the response.

    I'm not sure that answers the initial question though; usage example or if can't be done for an image.

    I would think one-off db information lends itself correctly to a custom user property, even an image.

    If not a property then how best to store a single image? A single record, single field table (Be it OLE or Attachment type)?

    Note I prefer to keep things contained within one db file, so while a link to an external stored image file is an alternative it is not a preferred solution.

    Thanks again.

    swas

  6. #6
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,428
    I suspect there is a limit to a property size. Had a quick look, only found this

    https://support.office.com/en-us/art...8-98c1025bb47c

    where a field property is limited to 255 chars

    as to how best - depends how you are going to use it. could be in a picture control on a form, report or button, could be an ole object in a table. I often have a single record configuration table for example, but personally I prefer to keep images separate.

  7. #7
    swas is offline Advanced Beginner
    Windows 10 Access 2013 32bit
    Join Date
    Apr 2017
    Posts
    32
    Not sure where you drew that info from in the attachment. No of fields 255, or characters in a short text field type is 255.

    Anyway I'll figure something out.

    Thanks

    swas

  8. #8
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,428
    it's in the table section

    Click image for larger version. 

Name:	Capture.JPG 
Views:	7 
Size:	14.8 KB 
ID:	35833

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

Similar Threads

  1. Replies: 5
    Last Post: 01-14-2013, 03:04 PM
  2. Replies: 9
    Last Post: 05-07-2012, 06:11 PM
  3. Replies: 3
    Last Post: 06-04-2011, 12:23 PM
  4. convert property TYPE to ENUM
    By ajetrumpet in forum Programming
    Replies: 4
    Last Post: 09-10-2010, 11:09 AM
  5. Image Buttons Menu type form
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-30-2010, 10:17 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