Solved

"Bitmap Image is not valid" raised when displaying TDBImage

Posted on 2004-09-30
7
722 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.

920 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

12 Experts available now in Live!

Get 1:1 Help Now