Solved

Image byte() in dataset to ACCESS 2007 attachment

Posted on 2010-09-20
6
494 Views
Last Modified: 2013-11-26
I have an image which is stored in a VB.NET dataset as a  byte().  The image displays well in the VB.NET program.  I would like to save this image out to an ACCESS 2007 database.  I have previsouly created databases which save images as the attachment type in ACCESS..
    How do I convert the byte() array so that it can eb saved as an ACCESS 2007 attachment?   Or perhaps there is another method?
0
Comment
Question by:Zimbug4
6 Comments
 
LVL 14

Expert Comment

by:systan
ID: 33717103
Have you tried that psuedo code snippet?
Dim MemS As New MemoryStream()

Dim pic As Image

pic = image1.Image

SavePhoto(pic, MemS)//get the buffer from pic image to MemS

Dim PicImage() As Byte = MemS.GetBuffer

sqlCom.Parameters.Add(New MySqlParameter("?pi", SqlDbType.Blob)).Value = PicImage

Open in new window

0
 

Accepted Solution

by:
Zimbug4 earned 0 total points
ID: 33721593
This appears to use the blob type which as I understand it is not recommended for ACCESS.  ACCESS2007 has the attachment type which is supposed to get around these issues but I can't figure out how to use it in VB.NET.   I tried creating a dummy table in ACCESS with the attachment type, but VB.NET will read this as a string type.
 
 I'm wondering if I'm not better off saving it as a hyperlink and the image in a file.
0
 
LVL 14

Expert Comment

by:systan
ID: 33723379
Its not recommended, but if its usable, why not use it.
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 12

Expert Comment

by:Mohamed Abowarda
ID: 33723400
0
 
LVL 16

Expert Comment

by:13598
ID: 33725235
0
 

Author Closing Comment

by:Zimbug4
ID: 38178261
After looking through everything I decided at the time loading the database would make it large quickly.  This was probably the best solution
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now