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
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old January 5th, 2007, 11: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)

        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


Reply With Quote
Reply


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 15th, 2014 12:05 AM
how do i load a wmf image jerryham VB.NET 0 October 20th, 2008 01: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 07:41 PM



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


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