Solved

How to upload image in msacess

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

Business Impact of IT Communications

What are the business impacts of how well businesses communicate during an IT incident? Targeting, speed, and transparency all matter. Find out more in this infographic.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
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…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

733 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