Page 2 of 2

Re: xBrowse jpg in SQL-database

Posted: Fri Nov 08, 2019 6:52 am
by nageswaragunupudi

Code: Select all

"0x" + STRTOHEX( MEMOREAD( ... ) )
 

Re: xBrowse jpg in SQL-database

Posted: Fri Nov 08, 2019 6:58 am
by nageswaragunupudi
Still, we advise you to adopt the approach and syntax advised by us in our samples above. They are safe and work with any database. You will not be wasting your time in searching for solutions like this.

Re: xBrowse jpg in SQL-database

Posted: Fri Nov 08, 2019 4:08 pm
by cdmmaui
Thanks Rao, that seemed to solve the problem. If I run in to any issues, I will contact you.

Re: xBrowse jpg in SQL-database

Posted: Thu Nov 14, 2019 3:54 pm
by Jack
Hi,
Is it the same with DOCX or XLSX or PDF ?

What is the instruction to read the file saved in a sql table and display it with WORD or Excel or PDF Viewer ?

Should we read from the blob field, save it to the disk with MEMOWRITE or FWRITE and the open the files ?

Thanks for your help .

Philippe .

Re: xBrowse jpg in SQL-database

Posted: Fri Nov 15, 2019 4:33 am
by nageswaragunupudi
We need to first write them to a temporary file on the disk and then open the file with appropriate application.

Writing to disk:

Code: Select all

// xharbour
MEMOWRIT( cFilename, oRs:Fields( "fieldname" ):Value, .f. ) // ADO
//or
MEMOWRIT( cFileName, oRs:fieldname, .f. ) // FWMARIADB library

// or both harbour and xharbour
HB_MEMOWRIT( cFileName, oRs:Fields( "fieldname" ):Value ) // ADO
// OR
HB_MEMOWRIT( cFileName, oRs:FieldName )