Link to home
Create AccountLog in
Avatar of cruams88
cruams88Flag for Philippines

asked on

How do I access pictures inside my Access Database using VB.NET 2005

I am a beginner in database programming and knows a little bit on VB.NET 2005 language. I just need some eye opener on how to get started on getting solution on my problem. I dont know where to start. I studied already Data Providers and sub-components of OleDb and quite familiar about its basic. All I need now is something that could guide me on how to access pictures from the Access database and place it into my form. I know how to access text datas in my database but I have no Idea on how to get started on accessing pictures. Hope anyone could help me out..
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

first, consider that loading images (and files in general) into a database is probably bad regarding the performance. If at all, you should store them in a separate database...

Besides that, you need to read about the .AppendChunk and .GetChunk to write/read to IMAGE (and TEXT) fields in SQL Server.
Another way to do this is store the file location in the database and simply place image files on the hard drive.  As far as removing the file just remove the record holding the location and then use the kill statement to delete the file off the hard drive.

How to insert an image in Access Database?

Other usefull links:

Save/Retrieve Image From SQL Server Database Using Ado 2.5 Stream Object

Perhaps these links can set you on your way 
Avatar of cruams88


so which do you recommend in implementing this kind of scenario?i think ill go for the easiest way.
Store all your images on your harddrive on a specific location.
Store the filename (with or without the complete path) in your database.
Just a follow up question. Do guys have an idea what could be an ideal number of population this type of database set-up can sustain that it is still stable?
What exactly do you mean ? Do you mean if there is a size-limit on a acces-database, ... ?
Yes..for example if I make a employee records about a company,is it still suitable to use Access database if the employee records goes to a thousand figure or counts?
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Forced accept.

EE Admin