#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Location
    Saudi Arabia
    Posts
    5
    Rep Power
    0

    Save image in the database


    hi every one

    i have done a program to scan images by scanner, but i have a problem how to save it in a database.

    please replay as soon as possible
  2. #2
  3. Second highest poster :p
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2001
    Posts
    7,322
    Rep Power
    33
    What database are you using? How you do things depends on how your database handles images.

    Also can you please stop putting "please replay as soon as possible". Everyone here (except the admins) does this on a volunteer basis. You get a reply if someone who knows the solution to your problem reads your post. We always try to reply to everyone as soon as we can.
    - Andreas Koepke

    Koepke Photography

  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Location
    Saudi Arabia
    Posts
    5
    Rep Power
    0

    replay ... !


    the database that i use is Access 2000.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Location
    USA
    Posts
    313
    Rep Power
    18
    Here is a basic example on how to do it with ADO. I have put this up on my site but would not suggest putting Pictures files in any database. One it makes the database huge, two it makes it hard to retrieve the files if you decide you no longer want them in the database, and three it is not a good practice to do this. The best way to do this is design your program to store locations to you files in the database and the reference them that way.

    LOCATION = c:\mypics\

    in the mypics folder you have all the images..

    ADO Database Picture Example
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2001
    Location
    Dublin
    Posts
    413
    Rep Power
    14
    you can save the image files as binary long object's (set the field type to ole object in access).

    then use ado's append chunk and getchunk methods to write and read your file data from / to byte arrays read using get, i think.



    Sorry folks - didn't see the reply above
    Last edited by epl; May 17th, 2003 at 06:54 AM.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Location
    USA
    Posts
    313
    Rep Power
    18
    Hey epl good reply and you are correct. The link to the example I have that is posted above does just that.
  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Location
    Saudi Arabia
    Posts
    5
    Rep Power
    0

    thanks !


    thanks for every one who help me in solving my problem. I will try it later.

IMN logo majestic logo threadwatch logo seochat tools logo