inserting picture in access database

mastana
09-08-2000, 02:09 PM
I want to save a picture displayed in a picture box in a database. I created an access database with an OLE field.
when i write
db1.recordset(1)=picture1.picture
it shows database conversion error.
How can I do it??

cbrewer
09-10-2000, 01:51 AM
mastana, I fought with this for a while, and never could get an answer from anyone. Since ado doesnt work with ole, I ended up linking textfields with the graphic name to the picture boxes. This is normally more efficient than embedding. let me know if you need more detail.

Hope that helps

Chuck

mastana
09-10-2000, 08:25 AM
Hi cbrewer, I need more help!! MS-Access gives this ability to actually embed a picture in a database(if u do it manually for every field) and it saves the data as longinteger. If we can set all other type of fields of an access table thru VB why can't we do with the OLE field? If ado dosen't support ole than dao may help???
Actually I am making a small data entry application for an online bookstore. the data they enter offline will be ported to their web site. I can get the path of the photo's saved in a field. But the path won't work on the server. SO I searched for this embedding facility in access, but now I can't use it thru VB. Any genious out there. Please help!!

cbrewer
09-10-2000, 10:30 AM
mastana,

VB does support the OLE through dao, but a picture box wont bind to it. The OLE object in VB will bind to the OLE object in Access. In order to get the object into a picture box, you need to run the application and then get the picture from the VB OLE object into the picture box ex...

Private Sub Command1_Click()
OLE1.AppIsRunning = True
Picture1 = OLE1.Picture
End Sub



Chuck

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum