• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 508
  • Last Modified:

Image byte() in dataset to ACCESS 2007 attachment

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
Zimbug4
Asked:
Zimbug4
1 Solution
 
systanCommented:
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
 
Zimbug4Author Commented:
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
 
systanCommented:
Its not recommended, but if its usable, why not use it.
0
Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

 
Mohamed AbowardaSoftware EngineerCommented:
0
 
Zimbug4Author Commented:
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

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now