How to extract the picture from database to the temporary folder in computer?
I have questions here. I use ADODB and Microsoft access
I have field name "Gambar" in the database with data type text. In the field,I have an image link for each record for example "C:\data\image1.jpg How I can extract the the image from database to temporary folder in the computer?This temporary folder will delate after the form unload. Any Idea or sample to start?
Re: How to extract the picture from database to the temporary folder in computer?
Thread moved to Database Development forum
Are you actually storing the picture in the database, or just the file name?
Re: How to extract the picture from database to the temporary folder in computer?
Si:
"I have field name 'Gambar' in the database with data type text. In the field,I have an image link for each record for example 'C:\data\image1.jpg'"
It sounds as if he's storing the file location. (How can you store a jpg image in a text field?)
Matrik, the file is already on the computer - in this case it's the file C:\data\image1.jpg. If you want it in a temporary folder, you'll have to write code to copy it from C:\data\ to the temporary folder. Then, to delete it "after unload", you'll have to write code to delete the file and close Access. (Or you could just use it from where it already is.)
Re: How to extract the picture from database to the temporary folder in computer?
Quote:
Originally Posted by Al42
It sounds as if he's storing the file location. (How can you store a jpg image in a text field?)
Agreed, but it is possible that there is also a field that contains the picture.
Re: How to extract the picture from database to the temporary folder in computer?
Quote:
Originally Posted by si_the_geek
Thread moved to Database Development forum
Are you actually storing the picture in the database, or just the file name?
It sound that, I have filename store in the database not the image:D . I would like to know how to store the picture in the database inside the field name "Gambar" ?I always use filename to store the image location in that field now I want to learn how to store the image itself not the storing the image path location. Do you have alternative way on how image store in the database? I use Microsoft access, I have 3 images in jpg format but in a small size. Do I need change the data type of my current field name?
Re: How to extract the picture from database to the temporary folder in computer?
Quote:
Originally Posted by si_the_geek
Agreed, but it is possible that there is also a field that contains the picture.
What the field type that contains picture?
Re: How to extract the picture from database to the temporary folder in computer?
Quote:
Originally Posted by Al42
Si:
to delete it "after unload", you'll have to write code to delete the file and close Access. (Or you could just use it from where it already is.)
Could you give me a sample to delete the temporary folder using code?
Re: How to extract the picture from database to the temporary folder in computer?
If you want to store the picture in the database, see the Tutorial about it in the FAQs & Tutorials thread at the top of this forum.
Re: How to extract the picture from database to the temporary folder in computer?
Quote:
Originally Posted by matrik02
Could you give me a sample to delete the temporary folder using code?
RmDir "C:folder\name\here\"
The folder has to be empty to delete it.