My goal is to programmatically set the OLE datatype field in one of my tables to the OLE object selected by a user via the Open File Dialog Box
ie. if the user selects "c:\my documents\Demo.xls" I want to set the 'Multimedia' field in my 'DataSetDetails' table to 'demo.xls'
I have painted a Bound Object Frame onto my form with the intention of setting all the necessary properties to this control and then assigning this control to the OLE field in my table. (hopefully my intentions and methods are clear)
so far my code is:
A With rstDataSetDetails
B .AddNew
C
D !StudyID = cboStudyID
E !DataSetDescription = txtDesc
F !DataSetStatus = txtDataStatus
G !DataType = cboDataType
H
I oleDataSetLink.Class = "Excel.WorkSheet" J ' Set class name.
K oleDataSetLink.OLETypeAllowed =acOLELinked L ' Specify type of object.
M oleDataSetLink.SourceDoc = strFile_Path D N ' the User selected source file c:\my E O documents\demo.xls.
P oleDataSetLink.Action = acOLECreateLink Q
R !Multimedia = oleDataSetLink
S .Update
T .Bookmark = .LastModified
U
V End With
This almost works, I receive no errors on Line R, however it does not successfully link the 'demo.xls' spreadsheet to the DataSetDetails table. Instead of displaying "Microsoft Excel Spreadsheet" in the DataSetDetails table the 'Multimedia' field displays "Long Binary Data" and the field's Value is an awful looking value of:
",
ÿÿÿÿWorksheetExcel.Sheet.8Access.OLE2Link@ÐÏࡱá>þÿ þÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
Any clues to get around this beauty?
ie. if the user selects "c:\my documents\Demo.xls" I want to set the 'Multimedia' field in my 'DataSetDetails' table to 'demo.xls'
I have painted a Bound Object Frame onto my form with the intention of setting all the necessary properties to this control and then assigning this control to the OLE field in my table. (hopefully my intentions and methods are clear)
so far my code is:
A With rstDataSetDetails
B .AddNew
C
D !StudyID = cboStudyID
E !DataSetDescription = txtDesc
F !DataSetStatus = txtDataStatus
G !DataType = cboDataType
H
I oleDataSetLink.Class = "Excel.WorkSheet" J ' Set class name.
K oleDataSetLink.OLETypeAllowed =acOLELinked L ' Specify type of object.
M oleDataSetLink.SourceDoc = strFile_Path D N ' the User selected source file c:\my E O documents\demo.xls.
P oleDataSetLink.Action = acOLECreateLink Q
R !Multimedia = oleDataSetLink
S .Update
T .Bookmark = .LastModified
U
V End With
This almost works, I receive no errors on Line R, however it does not successfully link the 'demo.xls' spreadsheet to the DataSetDetails table. Instead of displaying "Microsoft Excel Spreadsheet" in the DataSetDetails table the 'Multimedia' field displays "Long Binary Data" and the field's Value is an awful looking value of:
",
ÿÿÿÿWorksheetExcel.Sheet.8Access.OLE2Link@ÐÏࡱá>þÿ þÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
Any clues to get around this beauty?