Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with picture in general field in Interbase database

Status
Not open for further replies.

RedLion

Programmer
Sep 13, 2000
342
NL
Hello,

I've got an Interbase database with a blob field in it. A blob field is the same as a general field in VFP. I connect to the Interbase database through a remote view. I can copy a picture into the field with the command:

append general picture from myPic.jpg
tableUpdate(.T.)


And when I look through the browse window and double click on the field, the picture is displayed in a seperate window. When I do the same in the Interbase console, I get the error:

The format is not graphical
Bitmap image is not valid


I hope someone can help me, even if you don't know a thing from Interbase, may be you have some suggestions.

Thanks,

Charl
 
Charl,
The big diffrence between these fields is that a General field not only stores the data (like a BLOB), but it also stores information about the OLE Server that was used to store and "display" the data. The best you can do with a BLOB, is to trap the click, extract the data and fire up an appropriate application to "view" it (that's essentially what the VFP general field does for you).

Rick
 
Hi,

In Interbase a BLOB field can store TEXT or BINARY data.

You have to define it when create the table as

...cFieldName BLOB type BINARY (or TEXT)

I currently store text, images and ole objects in interbase/firebird database and I retrieve trought ODBC.

Your problem sounds as a IBConsole problem.

Ciao Andrea C.P.
Italy
 
Thanks Rick and Ciao for your response!

The problem is, I'm writing a import fuction, that imports products with a picture the product into the interbase database with VFP. The database with an application written in CBuilder is made by someone outside our company. And he has defined the field picture to store a picture from a product. The meta data for the field is:

PICTURE BLOB SUB_TYPE 0 SEGMENT SIZE 80

From within VFP I'm connected to the Interbase database through a remote view. The view says it is a general field.

Your problem sounds as a IBConsole problem.
The problem is that the CBuilder App also reports the same error The format is not graphical
Bitmap image is not valid
and I can't change anything to the app, I've to write the picture in a format to the database so the app can read it.

So, how should I write the picture on an other way to the picture field in the remote view?

Thanks,

Charl
 
Hi Red,

are you sure your app is able to read image in jpg format?

(like Vfp5 - BMP only) Andrea C.P.
Italy
 
Sorry Andrea, I've tried all kind of image files, and I get always the same error (even with .bmp)!

And the problem is not that mine VFP app can't read the data in the database (mine VFP app is writting data in the database) but the CBuilder app bought can't read the picture data when the data is written with mine VFP app in the database.

So I need to know how to write the picture through a remote view into the interbase database so that the CBuilder app can read the pic as always.

Rick you said The best you can do with a BLOB, is to trap the click, extract the data what do you mean exactly and how can I accomplish this?


Charl
 
Charl,
"Trap the click" - Add some code to the Click() event of the Editbox (probably) of the Grid/Browse.
The code would require you to copy the data out of the blob (memo) field into a temporary file, and then start the application to display this file.

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top