Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How To store and retrieve images from database in VC++

How To store and retrieve images from database in VC++

Scheduled Pinned Locked Moved C / C++ / MFC
databasec++comhelptutorial
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    savitri
    wrote on last edited by
    #1

    Hi All, I'm savitri here. I'm doing FingerPrint project. In this project i want to store fingerprint in database and retrieve that fingerprint for comparision.I created one table called "Images" with 2 fields called ID(AutoNumber)and Image(OLE Object). While inserting fingerprint i'm writing SQL statement like this. BYTE* buffer=new BYTE[1632]; buffer=m_RegTemplate.pbData;//m_RegTemplate is DATA_BLOB Type. "INSERT INTO Images(Image) VALUES('"+buffer+"')"; I'm not getting how to retrieve the fingerprint from the database table. i want to save that retrieved fingerprint into m_RegTemplate.pbData for comparision. Please tell me how to solve this problem and Give me some hints. Thanks in Advance Regards, Savitri P :)

    C B 2 Replies Last reply
    0
    • S savitri

      Hi All, I'm savitri here. I'm doing FingerPrint project. In this project i want to store fingerprint in database and retrieve that fingerprint for comparision.I created one table called "Images" with 2 fields called ID(AutoNumber)and Image(OLE Object). While inserting fingerprint i'm writing SQL statement like this. BYTE* buffer=new BYTE[1632]; buffer=m_RegTemplate.pbData;//m_RegTemplate is DATA_BLOB Type. "INSERT INTO Images(Image) VALUES('"+buffer+"')"; I'm not getting how to retrieve the fingerprint from the database table. i want to save that retrieved fingerprint into m_RegTemplate.pbData for comparision. Please tell me how to solve this problem and Give me some hints. Thanks in Advance Regards, Savitri P :)

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      You posted your question only 1 hour ago. This is a forum, not a chat. If you can't wait, then go on rentacoder and pay somebody to do the job for you.

      Cédric Moonen Software developer
      Charting control [v1.5] OpenGL game tutorial in C++

      E 1 Reply Last reply
      0
      • C Cedric Moonen

        You posted your question only 1 hour ago. This is a forum, not a chat. If you can't wait, then go on rentacoder and pay somebody to do the job for you.

        Cédric Moonen Software developer
        Charting control [v1.5] OpenGL game tutorial in C++

        E Offline
        E Offline
        Eytukan
        wrote on last edited by
        #3

        lol :D

        He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus

        1 Reply Last reply
        0
        • S savitri

          Hi All, I'm savitri here. I'm doing FingerPrint project. In this project i want to store fingerprint in database and retrieve that fingerprint for comparision.I created one table called "Images" with 2 fields called ID(AutoNumber)and Image(OLE Object). While inserting fingerprint i'm writing SQL statement like this. BYTE* buffer=new BYTE[1632]; buffer=m_RegTemplate.pbData;//m_RegTemplate is DATA_BLOB Type. "INSERT INTO Images(Image) VALUES('"+buffer+"')"; I'm not getting how to retrieve the fingerprint from the database table. i want to save that retrieved fingerprint into m_RegTemplate.pbData for comparision. Please tell me how to solve this problem and Give me some hints. Thanks in Advance Regards, Savitri P :)

          B Offline
          B Offline
          bulg
          wrote on last edited by
          #4

          what format is your image? If you're storing a bitmap file, you have to first insert the correct header information & then the raw data (i forget how many bytes the header is, but it's more than a few) Might check out "serializable" interfaces too

          S 1 Reply Last reply
          0
          • B bulg

            what format is your image? If you're storing a bitmap file, you have to first insert the correct header information & then the raw data (i forget how many bytes the header is, but it's more than a few) Might check out "serializable" interfaces too

            S Offline
            S Offline
            savitri
            wrote on last edited by
            #5

            Hi All, It is fingerprint template. I'm using DATA_BLOB Data type to store the image from the device.I'm not getting how to retrieve the stored image from the database. When i'm trying to retrieve the image from record set.that format is recset.GetFieldValue("Image",buffer);//buffer is of CDBVariant type.I want to assign the buffer value to another BYTE* variable. But i'm not getting how to do this? So please give me any hints to solve this problem. I'm also searching the solution and trying for all the options. Thanks in Advance. Regards, Savitri.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups