Solved

How to upload image in msacess

Posted on 2008-11-01
1
276 Views
Last Modified: 2012-05-05
I want to upload and reterive a image file in ms acess.I am making a desktop application in vb.net and in backend in ms acess..
0
Comment
Question by:raboy007
[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
1 Comment
 
LVL 12

Accepted Solution

by:
techExtreme earned 500 total points
ID: 22857894
Hello,
Follow this article, there it is explained in detail with source code for how you can pass image in byte stream format to upload to ms access database.
Article: http://programming.top54u.com/post/VB-Code-to-Upload-Image-to-MS-Access-Database-in-ASP-Net.aspx
Still I'm pasting code here for your reference

Dim imageSize As Int64 
Dim imageType As String 
 
Dim imageStream As Stream 
 
' Gets the Size of the Image 
 
imageSize = fileImgUpload.PostedFile.ContentLength 
  
 
' Gets the Image Type 
 
imageType = fileImgUpload.PostedFile.ContentType 
  
 
' Reads the Image stream 
 
imageStream = fileImgUpload.PostedFile.InputStream 
  
 
Store the InputStream using the above ASP file upload control function into the Stream type variable.  
  
 
Dim imageContent(imageSize) As Byte 
 
Dim intStatus As Integer 
 
intStatus = imageStream.Read(imageContent, 0, imageSize) 
  
 
Create the Byte array as in the above code to buffer the image binary stream byte by byte. 
 
To use the stream, you can import the following IO namespace: 
 
Imports System.IO

Open in new window

0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

707 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