saving image file to blob fields

Post Reply
User avatar
fraxzi
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines
Contact:

saving image file to blob fields

Post by fraxzi »

Anybody...


I'm working on ADS71 (CDX) and this function always returns false...

db->( adsfiletoblob('file.bmp', 'field', 7) )

//'field' is image type defined in arc32
//7 means image or 6 means binary

I thought of changing table from CDX to ADT... and so.

still returns false.

I changed field type to binary... still CANT SAVE IMAGE FILE TO FIELD...


Code: Select all

If db->( dbRLock( recno() ) )

   if db->( adsfile2blob('d:\images\picture.bmp', 'MAP', 7) )
      msginfo('file image saved to table')
   else
     msginfo('unable to save')  
   end

end

anybody with the workaround is truly appreciated.


regards,
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Frances,

This may be useful from Harbour ADS RDD docs:

<nBinaryType> Either ADS_BINARY (the default) or ADS_IMAGE. This parameter is for fields in DBF files. ADT tables cannot store binary and image data in standard character memo fields (they have specific field types for that).
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
fraxzi
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines
Contact:

Post by fraxzi »

Hello Mr. Antonio,

Thank you for the reply.

ADS_BINARY is 6 ands ADS_IMAGE is 7.

I used it in the third parameter (like the above) ADSFile2Blob('file','field',7)


I data type for 'field' is image or binary (ADT) but still not working...


Maybe there's problem with the wrapper ADSFile2Blob and, ADSBlob2File.


Anyone with a fix?


Regards,
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Frances,

The C wrapper seems ok:

ulRetVal = AdsFileToBinary( pArea->hTable, (UNSIGNED8*)szFieldName, usBinaryType, (UNSIGNED8*)szFileName );

it returns a logical value. Do you get .T. or .F. ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
fraxzi
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines
Contact:

Post by fraxzi »

Hello again Mr. Antonio,


The above coding returns .F. ( adsFile2blob() )...

Can I use the adsfilebinary() directly from xhb1.1/fivewin? If so how do you pass the parameter? adsfile2blob is much easier but I get .F. return.


Best regards,
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines
Contact:

Post by fraxzi »

OH MY GOD!!! I'M SO SORRY MR. ANTONIO...


The above is so true and correct! :lol:


my mistake was that the alias 'DB' is positioned EOF... :lol: :lol: :lol:


that is why the adsfile2blob is returning FALSE....



IT'S WORKING PERPECTLY.....


Regards to you Mr. Antonio :D
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
Post Reply