?
Solved

"Bitmap Image is not valid" raised when displaying TDBImage

Posted on 2004-09-30
7
Medium Priority
?
749 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
[X]
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
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 2000 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
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 MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

Question has a verified solution.

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

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…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Suggested Courses

762 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