?
Solved

Image byte() in dataset to ACCESS 2007 attachment

Posted on 2010-09-20
6
Medium Priority
?
504 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

752 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