Solved

Image byte() in dataset to ACCESS 2007 attachment

Posted on 2010-09-20
6
496 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

785 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