Wrox Programmer Forums
|
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics 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 September 26th, 2007, 05:14 AM
Authorized User
 
Join Date: Aug 2007
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to zrtv
Default LOAD PICTURE FROM MS ACCESS

Hi All,
Can any one tell me how to load picture from MsAccess to vb6. I stored the picture in MsAccess "OLE" field using the following code:
Private Sub Command1_Click()
    Set rspics = New ADODB.Recordset
    Set db = New ADODB.Connection
    Set mystream = New ADODB.Stream
    mystream.Type = adTypeBinary
    DBLoader
    db.Provider = DBDriver
    db.Open "Data Source = " & DBName
    CommonDialog1.Filter = "Photo Files(*.bmp,*.jpg,*.gif)|*.bmp;*.jpg;*.gif"
    CommonDialog1.ShowOpen
    Picture1.Picture = LoadPicture(CommonDialog1.FileName)
    rspics.Open "picturess", db, adOpenDynamic, adLockOptimistic
    rspics.AddNew
      mystream.Open
      mystream.LoadFromFile Trim(CommonDialog1.FileName)
      rspics.Fields("path") = Trim(CommonDialog1.FileName)
      rspics.Fields("pic") = mystream.Read
    rspics.Update
    rspics.Close
    mystream.Close
End Sub

How to load this picture from access to vb6. Plzzz Help






Similar Threads
Thread Thread Starter Forum Replies Last Post
MS ACCESS 2003 FRONTEND AND MS SQL SERVER 2005 DB mohankumar0709 SQL Server 2005 3 March 23rd, 2007 12:48 AM
Load picture from url rokujou Beginning VB 6 0 March 5th, 2007 07:08 AM
Re: Selecting a picture in MS Word VBA zainhansrod VB How-To 1 January 2nd, 2007 03:39 AM
load picture Jon Pro VB Databases 0 September 12th, 2004 09:36 AM





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