Hello Tutul128 ( funny nickname ), sorry just joking . . .
actually for OLE or BLOB data type has the same methods for Access, SQL server or
an ORACLE or else
-------- GetChunk and AppendChunk ----------- >>
- Put the picture in a picture box or image control
- Get the filename -- path file -- put in a textbox
My concepts like this
---------------------------------------------------------------------------
I made a Const Bytes_Sequence = 10000 ' buffer slice
I made a Const MAX_Size ' This is used as buffer for size of the file is
----------------------------------------------------------------------------
INSERT PICTURE
----------------------------------------------------------------------------
when i want to INSERT the Picture to curr field i make like this :
I get the filename ( from the textbox ) --> this is to get MAX_SIZE ( FileLen )
then i use - - - -( Open . . . Close Methods )- - - -
OPEN Filename For binary As #1
> in this section i slice the MAX_SIZE with BYTES_SEQUENCE
> use it in a loops ... Until MAX_SIZE = ( Zero )
> when i get the slice SIZE i used APPEND_CHUNK Methods
LIKE :
R!Curr_Fld = APPEND_CHUNK (bla . . bla)
> Close the Loops
Close #1 'Now we have got the binary that put in a field
Put the data PER_BYTES and fill it in a field
--------------------------------------------------------------------------------
GET THE PICTURE
--------------------------------------------------------------------------------
to get the picture from my database i have made a field that contains MAX_SIZE of
the file, and use the same methods, of course in a GET_CHUNK Methode and put it
per_bytes to a PICTURE BOX and Displayed in IMAGE CTRL.
-------------------------------------------------------
DELETING DATA
-------------------------------------------------------
Delete like usual from the PRIMARY_KEY of your database
-----------------------------------------------------------------
LOGICAL VIEW
-----------------------------------------------------------------
OPEN FILE FOR BINARY AS #1
LOOPS
MAX_SIZE / BYTES_SEQUENCE
|
SLICE_SIZE
|_________ ( SLICE_SIZE - BINARY) ------> FIELDS
END LOOPS
IF MAX_SIZE = ZERO
{
}
CLOSE #1
================================================== ===============
I have used this Methode for my Parking Programs and RENTAL CAR
that catch the Picture of a car from Camera and put the picture in a picture box transfered to field.
happy coding pale . . . bye !!!
================================================== ===============
|