Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB Databases
|
Pro VB Databases Advanced-level VB coding questions specific to using VB with databases. Beginning-level questions or issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 31st, 2004, 02:40 AM
Registered User
 
Join Date: Feb 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to tutul128
Default Sending & Retrieving Picture From Oracle To VB

Dear Friends

 I created a BLOB object table in Oracle. Now How Can I Insert, Delete,Update and How can I see the picture in Visual Basic 6.0
If any of you know about the procedure please send me your reference
with regards Tutul.

Hassanur
 
Old October 31st, 2004, 06:41 AM
Aal Aal is offline
Authorized User
 
Join Date: Oct 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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 !!!
================================================== ===============





Similar Threads
Thread Thread Starter Forum Replies Last Post
sending and retrieving image to/from sql mosi C# 2005 1 May 10th, 2008 07:51 AM
retriving picture from oracle using java ruzdi ASP.NET 1.0 and 1.1 Basics 0 March 18th, 2008 01:02 AM
problem with oracle & crystal report with Vb abhijhegde Beginning VB 6 1 May 3rd, 2007 12:03 PM
Retrieving Picture Metafile Wizardio Word VBA 0 June 5th, 2006 07:55 AM
Storing Images In Oracle & Manipulate Through VB 6 tutul128 Beginning VB 6 1 August 2nd, 2004 03:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.