Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Display Modes
  #1 (permalink)  
Old January 5th, 2007, 10:35 PM
Registered User
Join Date: Jan 2007
Location: , , .
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)


        Dim dr As OdbcDataReader
        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
Erro Messeger : Invalid Parameter

Image Type : CorelDraw.Graphic.7 ou Bits Map

any help??

Thanks Pedro

Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 09:51 PM
Load image from URL JonnyRPI ASP.NET 1.0 and 1.1 Basics 0 June 9th, 2003 06:41 PM

All times are GMT -4. The time now is 09:35 AM.

Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.