CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Guest

    Pictures in Database

    How can I display a picture on my form that is bound to a database?


  2. #2
    Join Date
    Aug 1999
    Posts
    2

    Re: Pictures in Database

    In case you are using access as your back end, in that case store the pic in the field with datatype "ole objects", later implement a Database Control over the form. and set its databasename & recordsource property, to the .mdb file & tablename respectivly. & link an OLE container or a picturebox or an Image Control to that Data Control.

    Best of Luck!

    In case you face problems you are welcome to contact me at...
    [email protected]


  3. #3
    Join Date
    Aug 1999
    Posts
    2

    Re: Pictures in Database

    I am using VB 5 to conect to Access. On my VB form, I have an OLE control and in my access DB I have a table with ole as one of the fields. How can I load a bmp, jpg, gif, etc into my ole control so it will save to the DB along with the other fields in the recordset?


  4. #4
    Join Date
    Aug 1999
    Location
    India-Delhi
    Posts
    106

    Re: Pictures in Database

    I use reference method in loading the picture files. In any database like access / SQl server you just keep the filename and in a label or picture use LOADPICTURE command to load li. the exact syntax is :

    mypic = mytb!thisPicture
    label1.picture = loadPicture(app.path & "\mypic")




    It supports all compressed format like JPG and GIF hence you can store more pictures compared to other PLE format taking large space.

    I hope this will solve the problem.

    regards.

    Santulan


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

Featured