Solved

How to upload image in msacess

Posted on 2008-11-01
1
273 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
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

770 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