FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse jpg in SQL-database
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse jpg in SQL-database
Posted: Fri Nov 08, 2019 06:52 AM
Code (fw): Select all Collapse
"0x" + STRTOHEX( MEMOREAD( ... ) )
Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse jpg in SQL-database
Posted: Fri Nov 08, 2019 06:58 AM

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.

Regards



G. N. Rao.

Hyderabad, India
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Re: xBrowse jpg in SQL-database
Posted: Fri Nov 08, 2019 04:08 PM

Thanks Rao, that seemed to solve the problem. If I run in to any issues, I will contact you.

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Posts: 300
Joined: Wed Jul 11, 2007 11:06 AM
Re: xBrowse jpg in SQL-database
Posted: Thu Nov 14, 2019 03:54 PM

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 .

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse jpg in SQL-database
Posted: Fri Nov 15, 2019 04:33 AM
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 (fw): Select all Collapse
// 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 )
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion