By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,658 Members | 1,612 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,658 IT Pros & Developers. It's quick & easy.

Any way to change the OLE type in an OLE field?

P: n/a
Hello,

I have some blob code that I use to polulate an OLE field with various
files. Some of the files are images. The information in the field says
"Long Binary Data" regardless of what I am writing to the field. Is there
any way to convert this to Picture?

Thanks!
Feb 26 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
The simplest method is to save the fields contents to a temp file on your
hard drive with the proper Image type file extension(bmp etc.). Then simply
set the Picture property of the standard Image control to the name of this
temp file. Cleanup as required.

Create a form with an OLE Frame control bound to the field in question.
Private Sub cmdSave_Click()
On Error GoTo Err_cmdSave_Click
Dim a() As Byte
Dim lTemp As Long
Dim sl As String
lTemp = LenB(Me.olePicture.Value)
ReDim a(0 To lTemp -1)
' Copy the contents of the OLE field to our byte array
a = Me.olePicture.Value
sl = "OLEfieldTestImage" & ".BMP"
Open sl For Binary Access Write As #1
Put #1, , a
Close #1
Exit_cmdSave_Click:
Exit Sub
Err_cmdSave_Click:
MsgBox Err.Description
Resume Exit_cmdSave_Click
End Sub

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Jozef" <me@you.com> wrote in message news:rY6Mf.2843$Ui.2646@edtnps84...
Hello,

I have some blob code that I use to polulate an OLE field with various
files. Some of the files are images. The information in the field says
"Long Binary Data" regardless of what I am writing to the field. Is there
any way to convert this to Picture?

Thanks!

Feb 26 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.