473,396 Members | 1,907 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,396 software developers and data experts.

Store and retrieve image in Access database

52
I have a form for staff details, the details come from Access and i am using this piece of code for my List box:

Expand|Select|Wrap|Line Numbers
  1. Private Sub lstRecord_Click()
  2.     rsMyRS.FindFirst " StaffID =" & Str(Split(lstRecord.List(lstRecord.ListIndex), vbTab)(1))
  3.  
  4.     txtStaffid.Text = rsMyRS!StaffID
  5.     txtFname.Text = rsMyRS!Firstname
  6.     txtSname.Text = rsMyRS!Lastname
  7.     txtDate.Text = rsMyRS!Date
  8.     txtDob.Text = rsMyRS!DOB
  9.     txtAddress.Text = rsMyRS!Address
  10.     txtCtown.Text = rsMyRS!City_Town
  11.     txtPcode.Text = rsMyRS!Postcode
  12.     txtTel.Text = rsMyRS!Tel
  13.     txtMob.Text = rsMyRS!Mobile
  14.     txtEmail.Text = rsMyRS!Email
  15.     txtPreocc.Text = rsMyRS!Preocc
  16.     txtNote.Text = rsMyRS!Note
  17.     optTemp.Value = rsMyRS!Temporary
  18.     optPermin.Value = rsMyRS!Permanent
  19. End Sub
what i wana do is add a picture box to my form. So when I click on a different name or the StaffId in the listbox, that staffs picture should show up.

Can you please tell me how to do this and what i will need to do on Access to enable this to happen.
Feb 5 '08 #1
5 2011
jamesd0142
469 256MB
access DB with staff name/id etc and a file path to the picture.

then when a user clicks the id field etc, run a query which selects the path associated with that id number and dumps the path into the picture box url...

im sure this will work
Feb 5 '08 #2
debasisdas
8,127 Expert 4TB
BTW how you have stored the image in access database ?

Is it file path or the file itself ?
Feb 5 '08 #3
THEAF
52
to reply to the first one as i am new to coding i don;t have much knowledge of queries and such so that will be difficult for me and to the second one I was thinking of using OLE Object as datatype and then insert the object into the place.
Feb 5 '08 #4
debasisdas
8,127 Expert 4TB
I was thinking of using OLE Object as datatype and then insert the object into the place.
That is the best thing to do.

You can find related articles in the articles section if VB.
Feb 5 '08 #5
Killer42
8,435 Expert 8TB
Actually, there has been a big discussion here recently about the best way to store and retrieve images in a database. I think you'll find it in the HowTo's area, but it may still be in Editor's Corner. Anyway, do a search on something like "BLOB image database" and you should find it.
Feb 6 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Tim James | last post by:
Newbie ASP Question. I hope this is the right place to ask. I have an ASP Upload element that I need help with. This is the problem I have 2 fields Image and FileName (FileName isnt the name of...
2
by: kabin selvam | last post by:
Hi, my scenario is like this, I have my document (word.or excel or pdf) stored a s a binary value(image datatype) in database, I need it to convert back into thedocument and save it as the file...
5
by: Roy Gourgi | last post by:
Hi, I am used to working in Visual FoxPro and I would like to be able to create a database and store and retrieve information from it. What is the simplest way to do it and what should I be...
2
by: Tim Zych | last post by:
How would I go about storing data files on my web host? I have an Access database driven website and I would like to save files and be able to download them. Can somebody point me in the right...
2
by: Rob | last post by:
Hi all, I've got multiple sets of radio button that are dynamically created in code and populated by a database query. The query returns about 20 recordsets with 3 radio buttons per recordset and...
6
by: Rudy | last post by:
Hello all! I am amazed how many posts I have read to store an image in SQL, and just as many against it. So I learned how to store an image in a SQL db and retrieve the image. A little tricky,...
3
by: Solution Seeker | last post by:
I want to Store the String value with Single Quotes in the Field of Database where if i try to Store the String value with Single Quotes (as it is) then it is throwing the error as SQL String...
0
by: Skiran | last post by:
Hi to everybody, I am handling a large-scale project of MIS (Marketing information System). I am using Vb 6 as front end, Ms Access as back end and Crystal report 8 as reporting tool. 1)...
0
by: PROGRAMMINGMAESTO | last post by:
How to Fetch and Retrieve image in ASP using MS Access. -------------------------------------------------------------------------------- Hello Friends, Can Anybody guide about how should i...
1
by: ravitkumar | last post by:
just send the code how to store and retrieve the image in a database using c# .net code
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.