Storing Images in the Database

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Bill Gage
Posts: 18
Joined: Fri 14 Oct 2005 17:23

Storing Images in the Database

Post by Bill Gage » Thu 22 Dec 2005 22:22

I am using a DevEx Grid to view and edit images I am storing in the database.

For the table I am working with there are two image fields.

Whenever I load an image that is 32 X 32 and post the record the everything works fine. However when I load and image that is 64 X 64 I get the
"The query processor could not produce a query plan..." blah blah blah blah.

Any idea how I can get this to work?

I have also tried loading the image into a TBlobField and posting it but get the same error message.

Bill

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Fri 23 Dec 2005 10:49

> I have also tried loading the image into a TBlobField and posting it but get
> the same error message.

Please try to use Pictures Demo from MyDAC/Demos folder to load this picture.

Bill Gage
Posts: 18
Joined: Fri 14 Oct 2005 17:23

Storing Images in the Database

Post by Bill Gage » Fri 23 Dec 2005 16:36

When I said I tried loading the image into a TBlobField the code I used was exactly the same as the Pictures demo.

I enabled the debugger to see what was being posted and this is what I saw

UPDATE IDM_MGR_FEATURES
SET
IMF_Feat_ID = :1, IMF_Feat_Name = :2, IMF_Image_SM = :3, IMF_Image_LG = :4, IMF_Button = :5
WHERE
IMF_Feat_ID = :Old_1

:1(Integer,IN)=1
:2(String[3],IN)='Log'
:3(Blob,IN)=
:4(Blob,IN)=
:5(Boolean,IN)=False
:Old_1(Integer,IN)=1

Then after closing the debug window I got the same error.

Bill

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Mon 26 Dec 2005 10:50

Can you reproduce this error without using third party components (DevEx Grid)?

Bill Gage
Posts: 18
Joined: Fri 14 Oct 2005 17:23

Post by Bill Gage » Tue 27 Dec 2005 16:56

Completely removed the grid and got the same error.

Bill Gage
Posts: 18
Joined: Fri 14 Oct 2005 17:23

Storing Images...Resolution

Post by Bill Gage » Tue 27 Dec 2005 17:01

For some reason I cannot have a clustered index on the table with multiple images. I took the clustered index off and everything works fine. I am not sure what I am losing by not having the clustered index, but fortunately the table isn't that large to worry about it.

Bill

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Thu 29 Dec 2005 10:22

Please send us (sdac*crlab*com) a complete small test project to reproduce the problem; don't use third party components

Also supply us following information

- Exact version of Delphi or C++ Builder
- Exact version of SDAC. You can see it in About sheet of TMSConnection Editor
- Exact version of Microsoft SQL Server and OLE DB provider that you use.
You can see it in Info sheet of TMSConnection Editor

Post Reply