How to solve Bitmap image is not valid error message?

Question

Why do I get the message (Bitmap image is not valid) before I can go online? I must first hit OK to go online. When I attempt to open another page while online, intermittently I get the error message to hit OK again.

Answer

This question was answered on March 18, 2003. Much of the information contained herein may have changed since posting.

Try this:

1 opened this database in IB_SQL:

dev:C:\Program Files\Common Files\Borland Shared\Data\mastsql.gdb

(dev is the host name of my development machine)

2 did this:

alter table parts

add pic blob sub_type 0

and committed it.

3 Created a new application in Delphi 6, dropped onto it a TIBODatabase,

a TIBOQuery, a TDatasource, two TDBEdits, a TDBImage and a TDBNavigator.

4 Pointed the Path to the database above, Server to 'dev', protocol to

cpTCP_IP Added password and username, named it 'db' and connected it.

5 Set up IBOQuery1 with with the following statement:

SELECT PARTNO, DESCRIPTION, PIC FROM PARTS

Linked its DatabaseName prop to 'db'.

6 Linked up the TDatasource to the query, then linked all other controls'

Datasource property to that and set the Datafield props of the 2 dbedits

and the dbimage.

7 Added this code to the forms OnCreate event handler:

if not IBODatabase1.connected then

IBODatabase1.connect;

if not IBOQuery1.active then

IBOQuery1.open;

8 Ran it, no errors.

9 While app was running, started Hypersnap (but any Windows graphics

program that supports bitmaps and clipboard would do...)

10 Opened a GIF graphic in Hypersnap, saved it as Windows bitmap, then

copied it to the clipboard.

11 Back in the application, clicked the Edit button on the TNavigator,

clicked into the TDBImage.

12 Ctrl-V to copy the image into the dbimage (it did) and clicked the

post button Autocommit was true.

13 Proceeded to similarly drop bitmaps into several other Parts records.

14 Closed the app.

15 Restarted the app All bitmaps previously added were present.

Need Help with this Issue?

We help people with technology! It's what we do.
Schedule an Appointment with a location for help!

Author

Posted by Enyenihi of Katharine Gibbs School - New York on March 18, 2003