Solved

How to upload image in msacess

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Familiarize people with the process of utilizing SQL Server views 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 Microsoft Access…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

911 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now