Results 1 to 9 of 9

Thread: How to extract the picture from database to the temporary folder in computer?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    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?

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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?

  3. #3
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    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.)
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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.

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    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 . 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?

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    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?

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    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?

  8. #8
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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.

  9. #9
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    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.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width