Hey all

Hey all,

I'm wondering if anybody else has ever encountered this problem, or something similar and perhaps has a solution or different work around.

I have 2 tables in a database:
Primary table with multiple fields containing different status (integer) values per record (3000 records)
Secondary table with a status (integer) field, description and an image field (15 records)

I would like to have the secondary table as a lookup table for the different statuses in the primary table, basically an image lookup dataset. However TDataset does not allow me to have a blob field as a lookup field.

I could modify the primary dataset SQL to return each image and description for each status, however this would mean fetching the status image blobs multiple times, which is obviously not efficient.

Any suggestions....

Comments

  1. Why not fetch 15 status images at initialization and use it as a (lazy) cache providing calculated field for the first table ?

    ReplyDelete
  2. I have been leaning towards that, however 2 things. What to store them in, TList, image list? And when to update? It just seems to go against the grain for me. Why is it not possible? PS I should also mention that I am using fibplus and fb2.5.

    ReplyDelete
  3. There are 3rd party controls that allow you to use different fields for display and lookup (eg, DevExpress).

    ReplyDelete
  4. I am using DevExpress, seems like they prefer to use imagelists. I have resorted to manually loading all images into an imagelist and using this, while refreshing when I receive an event from the database that the table has changed, which should be very rare in operation.

    ReplyDelete

Post a Comment