?
Solved

How to upload image in msacess

Posted on 2008-11-01
1
Medium Priority
?
277 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 2000 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
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…
Suggested Courses
Course of the Month15 days, 16 hours left to enroll

743 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