Linking or Embedding an OLE Object in an Access OLE DataType Field using DAO 
Author Message
 Linking or Embedding an OLE Object in an Access OLE DataType Field using DAO

Greetings all,

Would anyone know how I can write or embed or link or Bind an OLE object to
an Access Database field using DAO?  I would like to save a photo along with
other employee
information to that database.  Is this possible?

I have an application I have created in VB which saves various types of
information but when I try to save a photo, I run into a brick wall.

I have code below which finds and embeds the object(picture) to the OLE
Container.

    CommonDialog1.Filter = "Pictures (*.bmp;*.ico)|*.bmp;*.ico"
    CommonDialog1.ShowOpen
    MyPictureLocation = CommonDialog1.filename
    OLE1.CreateLink (MyPictureLocation)

How do I take that information and save it to an OLE DataType field in
Access using DAO?   Below is code that writes the rest of the field to the
database.

On Error GoTo Errors

    If rsMyData.RecordCount > 0 Then
      rsMyData.MoveLast
    End If

    rsMyData.AddNew
    rsMyData!LastName = txtEdit(0).Text
    rsMyData!FirstName = txtEdit(1).Text
    rsMyData!HomePhone = frmEdit.MaskEdBox1(0).Text
    rsMyData!StreetAddress = txtEdit(3).Text
    rsMyData!City = txtEdit(4).Text
    rsMyData!State = txtEdit(5).Text
    rsMyData!zip = MaskEdBox2.Text
    rsMyData!EmployeeID = txtEdit(7).Text
    rsMyData!SSNumber = MaskEdBox1(1).Text
'**************
    If MyPictureLocation <> "" Then
      'rsMyData!EmpPhoto = OLE1 '(This Does not work)
    End If
'***************
    rsMyData.Update

I would be happy for any suggestions on how this might be accomplished as I
seem to be running into brick walls with this one.  This should be possible,
shouldn't it??

Thanks in advance,
William Oliveri



Thu, 12 Jul 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Linking or Embedding an OLE object into an Access OLE DataType Field using DAO

2. linking or embedding an OLE object to an Access field using DAO

3. Insertion of OLE-Object into OLE-Field of Access-Table

4. storing an OLE object into an Access OLE field

5. VBA-assigning an OLE-object to an Ole-object-field

6. Retrieving Access OLE Object data from Word VBA using DAO

7. Store file as OLE-object in image-datatype field

8. Beginners Help with OLE Linked or Embedded object

9. Converting Embedded OLE Object to Linked

10. Converting Embedded OLE Object to Linked

11. OLE-Header for inserting Bitmap in DAO-ole-field

12. VB30: Accessing OLE-field in ACCESS-DB via OLE-VBX

 

 
Powered by phpBB® Forum Software