Link to home
Start Free TrialLog in
Avatar of LUIS957
LUIS957

asked on

"Bitmap Image is not valid" raised when displaying TDBImage

Hi guys,

I moved my paradox tables to SQL and I am trying to access the new Database using the same Application thru ODBC. I cannot access the bitmaps stored in the blob fields using the TDBimage controls.
An error raises: "Bitmap Image is not valid" for every record when a TDBimage refers to one of its fields.
On the other hand, if I paste an image on one of them, they work fine.
I´ve tried hard to look for a solution by myself, but It´s beyond my knowledge, so I´d appreciate some help.

Thanks.
Avatar of arbert
arbert

How did you move the tables and what datatype are you using bor the bitmap column?
ASKER CERTIFIED SOLUTION
Avatar of gwalkeriq
gwalkeriq

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of LUIS957

ASKER

I created an ADOCommand with run-time created parameters like that:

for k:=0 to table1.FieldCount-1 do
begin
with AdoCommand1.Parameters.AddParameter do
begin
name:=table1.Fields[k].FieldName;
case table1.Fields[k].DataType of
ftgraphic:datatype:=ftblob;
else
datatype:=table1.Fields[k].DataType;
end;
Size:=table1.Fields[k].size;
end;
{... other stuffs...}
end;

then
I use a SQL sentence like bellow:
Insert into <table> (field1,...,blobfield,...,fieldn) values (:field1, ...,:tblobparameter,...,:fieldn)

I am using "image" datatype for the table field
for the tblobfield.blobtype property I am using "ftblob"

Either I use an ADOTable with OLEDB or I use TTable with ODBC I get the message, then I suppose something wrong has occured during the moving of the tables.

 
I remeber this is a bug in some versions of the ODBC drivers that cause problems when moving blobs that are greater than 64K in length. Does this seem likely?
Avatar of LUIS957

ASKER

Most of the images where captured from a scanner. Some of them thru paint.
Avatar of LUIS957

ASKER

I'm sorry I didn´t answered it before. It took me some time to test the hipotesys of using other format than BMP in the tdbimage component. I was using an extended version of it which could accept JPG and GIF formats. It seems the extended version was prepared to deal with those format if they come from a paradox database, but not from MSSQL.