I am working on a VBA program in MS outlook in which I am using ADO to update ms access database. It works fine for my text fields, but I am not sure how to update an Embedded Object field. Anyone know how I can do this
For example I have a database called C:/Test.mdb with table "My_Table" containing a field called "Email_Message" with data type OLE Object:
Function LogEmails()
Dim msg As MailItem
Dim rs As New ADODB.Recordset
Dim cn As New ADODB.Connection
Dim strSQL As String
Dim FilePath As String
Set msg = ActiveExplorer.Selection.Item(1)
FilePath = "C:\Test.mdb"
Set cn = New ADODB.Connection
With cn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "data source=" & FilePath
.Open
End With
Set rs = New ADODB.Recordset
strSQL = "UPDATE [My_Table] SET [Email_Message] = " & msg & " WHERE [Item_ID] = 2"
rs.Open strSQL, cn
Set rs = Nothing
End Function
Thanks,
Dudeman

How do Programmatically insert an ole object into an access database
issarto
you have to write it to the field byte by byte....see the following for more info:
http://msdn2.microsoft.com/en-us/library/87z0hy49.aspx
http://msdn2.microsoft.com/fr-fr/library/aa735738(VS.71).aspx