Wrox Programmer Forums
|
BOOK: Access 2003 VBA Programmer's Reference
This is the forum to discuss the Wrox book Access 2003 VBA Programmer's Reference by Patricia Cardoza, Teresa Hennig, Graham Seach, Armen Stein; ISBN: 9780764559037
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Access 2003 VBA Programmer's Reference 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 January 5th, 2007, 11:35 PM
Registered User
 
Join Date: Jan 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default load a image from database


hi, I have a problem, I can´t load a image from database (Access)

my code,
'''''''''''
        Dim cnn As New OdbcConnection
        cnn.ConnectionString = "DSN=Imag"

        Dim sSql As String

        sSql = "SELECT Imagem,Imagem1 FROM Imagens"

        Dim cmd As New OdbcCommand(sSQL, cnn)

        cnn.Open()

        Dim dr As OdbcDataReader
        'cn.Open()
        dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)
        If dr.Read Then
            Dim bytBLOBData(dr.GetBytes(1, 0, Nothing, 0, Integer.MaxValue) - 1) As Byte
            dr.GetBytes(1, 0, bytBLOBData, 0, bytBLOBData.Length)
            Dim stmBLOBData As New MemoryStream(bytBLOBData)
            PictureBox1.Image = Image.FromStream(stmBLOBData)
        End If
        dr.Close()
''''''
Erro Messeger : Invalid Parameter

Image Type : CorelDraw.Graphic.7 ou Bits Map


any help??

Thanks Pedro







Similar Threads
Thread Thread Starter Forum Replies Last Post
How to load image from sql database to datagrid huyfamily SQL Server ASP 1 April 14th, 2014 11:05 PM
how do i load a wmf image jerryham VB.NET 0 October 20th, 2008 12:55 PM
How to load image from sql database to datagrid huyfamily ADO.NET 2 January 12th, 2004 10:51 PM
Load image from URL JonnyRPI ASP.NET 1.0 and 1.1 Basics 0 June 9th, 2003 06:41 PM





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