How can I display a picture on my form that is bound to a database?
Printable View
How can I display a picture on my form that is bound to a 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]
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?
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