I'm trying to write an application which does the following.
1) A user drags an item (could be Email, Word, Excel, Picture, etc) and drops it on an OLE Container.
2) When they click a Button, this then INSERTs the object into a SQL Server database table.
3) Another form, needs to be able to retrieve this object into an OLE container, so the user can double click on it to view it.
I can get step 1 to work no worries. It's just the second step where I'm having issues.
With this code that I'm using I get a String or Binary will be truncated error. I've made the SQL field, a Binary and a VarBinary with no success.
fd = FreeFile
Open OLE1.SourceDoc For Binary Access Read As fd
flen = LOF(fd)
If flen = 0 Then
MsgBox "Error while opening the file"
Set object = mcmdCurrent.CreateParameter("item", adLongVarBinary, adParamInput, flen + 100)
ReDim chunk(1 To flen)
Get fd, , chunk()
' Insert the object into the parameter object
' Now execute the command
Set rs = mcmdCurrent.Execute
Any ideas ? Am I on the right track ? I'm really bashing my head against the wall on this one. I've search hundreds of web pages with no success.