Solved

"Bitmap Image is not valid" raised when displaying TDBImage

Posted on 2004-09-30
7
715 Views
Last Modified: 2009-07-29
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.
0
Comment
Question by:LUIS957
  • 3
  • 2
7 Comments
 
LVL 34

Expert Comment

by:arbert
ID: 12194852
How did you move the tables and what datatype are you using bor the bitmap column?
0
 
LVL 6

Accepted Solution

by:
gwalkeriq earned 500 total points
ID: 12195540
How were the images stored in paradox (i.e., GIF, BMP,etc.). As I recall, default bitmap viewers (TImage or TDBImage) in Delphi only support windows bitmap and JPEG by default, you have to add extra code to support GIF, etc.
0
 

Author Comment

by:LUIS957
ID: 12195548
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.

 
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 6

Expert Comment

by:gwalkeriq
ID: 12195606
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?
0
 

Author Comment

by:LUIS957
ID: 12195612
Most of the images where captured from a scanner. Some of them thru paint.
0
 

Author Comment

by:LUIS957
ID: 12445356
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.
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now