how store Image into Database

how store Image into Database

Postby Jimmy » 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
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: how store Image into Database

Postby nageswaragunupudi » 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: Select all  Expand view
FIELD->IMAGE := MEMOREAD( "picture.jpg" )

RDBMS:
Code: Select all  Expand view
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
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: how store Image into Database

Postby nageswaragunupudi » 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: Select all  Expand view
FIELD->IMAGE := MEMOREAD( "picture.jpg" )

RDBMS:
Code: Select all  Expand view
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
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: how store Image into Database

Postby Jimmy » 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: Select all  Expand view
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
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 54 guests