Results 1 to 5 of 5

Thread: [RESOLVED] How to database images and access them?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2004
    Posts
    185

    [RESOLVED] How to database images and access them?

    I have a project where the application needs to display certain images based on different user inputs and selections. There are hundreds of pictures and it's OK for them to be statically linked, however the application will need to be distributed eventually, probably by CD.

    I could just make one big directory for all of the images, and hard link them all, and that would get the job done, but I was wondering if it would be any better to create a database of images (or something else even)? I've never worked with databases at all, so I don't know what the advantage of doing this might be, and how I would go about creating the database in the first place? One advantage I was thinking of was a cleaner install/file structure, rather than having the user be able to access each image file on the CD, really only the application could access them, and it's just the 2 files necessary to run the application, the executable and the database.

    So, is there any benefit to using a database for the images, or should I just statically link them? If there is a benefit to using a database, can anyone point me in the right direction as far as how to create the database?
    Last edited by pjrage; Jun 22nd, 2009 at 02:03 PM. Reason: Resolved

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: How to database images and access them?

    Quote Originally Posted by pjrage View Post
    however the application will need to be distributed eventually, probably by CD.
    Distributed to whom?

    Will this be a strickly in-house, corporate, application or do you intend to market this commerically?

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: How to database images and access them?

    You should look at creating a satellite assembly, which is a DLL containing nothing but resources. That way your images are all binary and not easily accessible or editable by the user but they are separate from your core application.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: How to database images and access them?

    jmc's suggestion is probably the best way to go. there's no need for a database in this case, and would end up creating more of a hassle than anything else. if you add the images to an assembly as resources, then expose them as shared public read only properties, not only is that easy to deal with, but updates to the images (or adding/removing ones) becomes a lot easier as well.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Sep 2004
    Posts
    185

    Re: How to database images and access them?

    Thanks for the ideas guys! I'm looking into satellite assemblies now and it seems like just what I need.

    This project won't ever be commercial or anything like that. More like a widespread internal distribution.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width