FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour how store Image into Database
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
how store Image into Database
Posted: Sun Jul 23, 2023 10:40 AM
hi,

i want to "store" Image into Database

Question :
which Type for DBF ? "M" or "V" or ?
which Type for SQL ? "BLOB" or ?

when store "Image" into
DBF using HEX or MEMOREAD ?
SQL using HEX with "pre-FIX" ?

when XBROWSEr / EDIT how to prevent FIELD from "type into" Image FIELD ... how to "Drop into" ?

which \Sample can show me how to begin under Fivewin :?:
greeting,

Jimmy
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: how store Image into Database
Posted: Sun Jul 23, 2023 11:49 PM
If you are using DBF via DBFCDX, use memo fields. ( DataType 'M' )
If you are using any RDMS use BLOB fields.

DBF:
Code (fw): Select all Collapse
FIELD->IMAGE := MEMOREAD( "picture.jpg" )
RDBMS:
Code (fw): Select all Collapse
oRs:image := MEMOREAD( "picture.jpg" )
If you are browsing in XBrowse, you can copy image from any source and paste into the cell.
This works for all datasources, viz, dbf, tdatabase, ado, fwmysql, dolphin, tmysql, postgre, arrays, etc.
Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: how store Image into Database
Posted: Sun Jul 23, 2023 11:49 PM
If you are using DBF via DBFCDX, use memo fields. ( DataType 'M' )
If you are using any RDMS use BLOB fields.

DBF:
Code (fw): Select all Collapse
FIELD->IMAGE := MEMOREAD( "picture.jpg" )
RDBMS:
Code (fw): Select all Collapse
oRs:image := MEMOREAD( "picture.jpg" )
If you are browsing in XBrowse, you can copy image from any source and paste into the cell.
This works for all datasources, viz, dbf, tdatabase, ado, fwmysql, dolphin, tmysql, postgre, arrays, etc.
Regards



G. N. Rao.

Hyderabad, India
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: how store Image into Database
Posted: Tue Jul 25, 2023 10:38 PM
hi,

thx for Answer
nageswaragunupudi wrote:This works for all datasources, viz, dbf, tdatabase, ado, fwmysql, dolphin, tmysql, postgre, arrays, etc.
found out
when want to use Postgre i NEED to use TPQserver / TPQquery as it is "hardcode" in Source
Code (fw): Select all Collapse
METHOD Load( lBlank ) CLASS TDataRow

   ELSEIF VALTYPE( ::uSource ) == 'O'
      IF ::uSource:ClassName == "TOLEAUTO"
         ... 
      ELSEIF ::uSource:IsKindOf( 'TDOLPHINQRY' )
      ELSEIF ::uSource:IsKindOf( "TMSQUERY" )
      ELSEIF ::uSource:IsKindOf( "TPQQUERY" )
      ELSEIF ::uSource:IsKindOf( "TXBROWSE" )
   ELSEIF VALTYPE( ::uSource ) $ 'AH'
so i have to revise my CODE to use these CLASS to work with Fivewin Controls
greeting,

Jimmy

Continue the discussion