I know, I know - OLE Objects create huge databases! In this case I only have several very small images, so no problem with size.
What I'm trying to do however, is insert an OLE Object into a table using VBA/SQL. Currently I have the following code:
ProjectIcon is the OLE Object field in the table and strProjectIconPath holds the path to the image that needs inserting. The above code doesn't error, but the ProjectIcon field in the table reads 'Long Binary Data' rather than 'Bitmap Image' as it should if the code works properly!
Is there a way to successfully insert an image using INSERT INTO or do I need to use another method? I'm still quite new to VBA, so my understanding of how OLE Objects work is a bit sparse!
Thanks,
Simon
What I'm trying to do however, is insert an OLE Object into a table using VBA/SQL. Currently I have the following code:
Code:
CurrentDb.Execute ("INSERT INTO tblProjects ( ProjectName, ProjectPath, ProjectIcon, ProjectLogoPath ) " & _
"VALUES ( '" & IIf(StrComp(UCase(strProjectName), strProjectName, vbBinaryCompare) = 0, strProjectName, StrConv(strProjectName, vbProperCase)) & "','" & strProjectPath & "','" & strProjectIconPath & "','" & strProjectLogoPath & "' );")
ProjectIcon is the OLE Object field in the table and strProjectIconPath holds the path to the image that needs inserting. The above code doesn't error, but the ProjectIcon field in the table reads 'Long Binary Data' rather than 'Bitmap Image' as it should if the code works properly!
Is there a way to successfully insert an image using INSERT INTO or do I need to use another method? I'm still quite new to VBA, so my understanding of how OLE Objects work is a bit sparse!
Thanks,
Simon