I 2nd "real database".  You can also use MS sql express, although it
probably isn't as easy to use as mysql.  And there is the ongoing debate
about whether it is a best practice to store images in a database, or
use the file system and just store a path in the db.  In my mind it
comes down to how many bytes are involved, and databases are getting
better at being really big.  I've used sql server to store rtf documents
(I think the arguments are parallel) and it works very well.  I don't
have to manage  folder size (windows folders don't like having billions
of files, so you have to generate new subfolders when you get to
whatever threshold you choose to observe).

 

Jeremy

Barry,

You might consider using a "real" database. ;-)

Seriously though, Access is pretty bad and only suitable for very
small, low performance apps. Interbase is only marginally better.

MySQL, another DB engine, is free and there are some great Delphi
components for it. Check out the ZeosLib components - they are free,
open source and in active development.

You can download the community version of MySQL from their web site.
Installation is pretty easy, and there are lots of books about it at
the bookstore. MySQL can support ~100 simultaneous users and can be
used over the Internet.

I use MySQL and Zeoslib components in all my DB applications that run
at large companies.

In answer to your original question, you probably want to use BLOB
records to store the binary portion of the image, and save the image
type in another field of the DB. As you load a record, you'll have to
pass the BLOB to the appropriate image viewer, based on your image
type field contents.

DevExpress has a TcxDBImage component that supports BMP, ICO, JPG, and
PNG, or you could do something clever with streams and some other
cheaper image component. DevExpress is expensive, but worth it.

There may be other components that will get the job done - maybe
someone else can chime in here.

HTH!

Kevin G. McCoy

> Hi
> 
> I`m learning Delphi and have done a sample application with ADO
> 
> and a Microsoft Access database. All was working well until I
attempted
> 
> to add a TDBImage control and save a image to the Access database.
> 
> It seems for some strange reason that only bmp images are easily
> 
> allowed. How would one deal with allowing the user to add these
> 
> various image types: jpeg, tiff, pdf, etc. I`ve looked on the web but
> 
> there does not seem to be a solution that deals with all these types. 
> 
> I`ve never worked with Interbase... does that database deal with this
> 
> issue better then Access.
> 
> 
> 
> Thanks and Regards, Barry
>



Reply via email to