473,387 Members | 1,597 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to retriving the Image files from ACCESS 2003

Hi All ,

I've stored the Image file..... But i want to retriving the Image
files from MSACCSS 2003 (JPEG,bmp,Gif and etc....) So Pls help
me........ help me...............
Thanking you,
Somasundaram G

Feb 23 '07 #1
2 1643
Soma,

Have a look of this one, it handles the offset too from the old Access use.

http://www.vb-tips.com/dbpages.aspx?...d-253a1ec85fc3

Cor

<so**************@gmail.comschreef in bericht
news:11**********************@v33g2000cwv.googlegr oups.com...
Hi All ,

I've stored the Image file..... But i want to retriving the Image
files from MSACCSS 2003 (JPEG,bmp,Gif and etc....) So Pls help
me........ help me...............
Thanking you,
Somasundaram G

Feb 23 '07 #2
Hi,
still not getting the retrive the image FROM Access Database... i wrote the code...But iam getting these Error.... So pls Make it....

Unable to cast of type 'system.String'to type 'System.Byte[]'


Private Sub cmb_id_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb_id.SelectedIndexChanged
Try
'Dim Emp_id As String = ""
MsgBox(cmb_id.SelectedItem)
con.Close()
con.Open()

cmd = New OleDbCommand("select * from emp_details_tab where emp_id=" & cmb_id.SelectedItem & "", con)
dr = cmd.ExecuteReader()
While dr.Read()

txt_name.Text = dr.GetValue(1) '("emp_name")
txt_address.Text = dr.GetValue(2) 's("emp_address")
MaskedTextBox1.Text = dr.GetValue(3) '("dob")
MaskedTextBox2.Text = dr.GetValue(4) '("doj")
txt_qualify.Text = dr.GetValue(5) '("Qualify")
txt_no_yrs_exp.Text = dr.GetValue(6) '("No_Of_Yrs")
txt_worked_exp.Text = dr.GetValue(7) '("Experinced_Details")
Dim retval As Long

Dim buffersize As Integer = 100
Dim outbyte(buffersize - 1) As Byte
Dim bw As BinaryWriter

Dim k As Long

Dim fs As New IO.FileStream("employ_Image", FileMode.OpenOrCreate, FileAccess.Write)
bw = New BinaryWriter(fs)
k = 0
retval = dr.GetBytes(1, k, outbyte, 0, buffersize)
Do While retval = buffersize
bw.Write(outbyte)
bw.Flush()
k += buffersize
retval = dr.GetBytes(1, k, outbyte, 0, buffersize)
Loop
bw.Write(outbyte, 0, retval - 1)

Emp_image.Image = Image.FromFile(filepath)

bw.Close()
fs.Close()

MsgBox("Image Retrived")
End While

Catch ex As Exception
MsgBox(ex.Message)
Finally
con.Close()
End Try
EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com
Mar 1 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Eric Kincl | last post by:
Hello, its been a while since I posted/looked here... my normal email client doesn't handle newsgroups :( (ximian evolution) I was wondering how you stick a file into a database, and then...
3
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a...
2
by: Steve | last post by:
Can anyone please advise me on the following : I am developing an access 2002 app that shows a customers picture, the picture is stored on the hard drive not in a table. I use the following code...
4
by: Shumit Rehman | last post by:
Hi I have a table which has path names to photos I would like to view. I would like to open some/any kind of image viewer(Paint) to see the picture when I click the pathname. The pictures are...
7
by: needin4mation | last post by:
Hi, I have an Access 2002 - 2003 database. I am using Access 2003. Whenever I link an image all it shows is the filename. Not the image. Other versions of Access can link the image just fine. ...
5
by: mikez | last post by:
Hi, We recently built a very basic file management system for a client in Access 2003 (to use with incoming tif scans). In it we used Microsoft's Document Imaging activex viewer (from Office...
1
by: Kunal Nandi | last post by:
can any one give me the code for uploading and retriving image using Blob, with jsp at front end and oracle8i at the back end ??????? i have tried this using long raw datatype i was able to upload...
3
kaleeswaran
by: kaleeswaran | last post by:
ResultSet rs=st.executeQuery("select i_sign from t_customer_photo where n_customer_id=1"); while(rs.next()) { byte...
2
by: Marco Pais | last post by:
Hi there. I'm developing a small application that uses Web Services to access database and store data. At some point, I store some images, by inserting the absolute image path into a varchar...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.