xBrowse jpg in SQL-database

User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xBrowse jpg in SQL-database

Post by nageswaragunupudi »

Code: Select all

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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xBrowse jpg in SQL-database

Post 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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
cdmmaui
Posts: 653
Joined: Fri Oct 28, 2005 9:53 am
Location: The Woodlands - Dallas - Scottsdale - London
Contact:

Re: xBrowse jpg in SQL-database

Post by cdmmaui »

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
Jack
Posts: 249
Joined: Wed Jul 11, 2007 11:06 am

Re: xBrowse jpg in SQL-database

Post 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 .
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xBrowse jpg in SQL-database

Post 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 )
 
Regards

G. N. Rao.
Hyderabad, India
Post Reply