"Bitmap Image is not valid" raised when displaying TDBImage

Posted on 2004-09-30
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.

Question by:LUIS957
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 34

Expert Comment

ID: 12194852
How did you move the tables and what datatype are you using bor the bitmap column?

Accepted Solution

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.

Author Comment

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

for k:=0 to table1.FieldCount-1 do
with AdoCommand1.Parameters.AddParameter do
case table1.Fields[k].DataType of
{... other stuffs...}

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.

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!


Expert Comment

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?

Author Comment

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

Author Comment

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.

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

738 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