472,337 Members | 1,444 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,337 software developers and data experts.

"Long binary data" in Access db

I have an off-the-shelf app that uses an Access database as its
backend. One of the tables contains a field with an "OLE Object"
datatype. I'm writing some reports against this database, and I
believe this field contains data I need. When I view the table in
datasheet view, all I can see in this field is the string "Long
binary data".

So, I've got the problem of needing to extract data from this
field, but I don't know what format the data is in, or how the app
inserts data to begin with. If I can extract the binary data
intact, I may be able to pick it apart and find what I need. I'm
looking for a solution that lets me get at the data for the whole
table, so an export of the whole table including the binary data
would be fine.

I'm not a VB or ASP coder, but if code is needed for this I can
probably copy code samples and make simple modifications to suit my
task. Is there any hope of extracting this data?
Nov 13 '05 #1
8 24893
It depends whether the App inserted the data as an OLE object or simply
as data in some format.

Create a form bound to this table. Add a BOUND Object Frame control
bound to the OLE field in question.

Now open the form in Form view. If you can see the data and interact
with it then you have an OLE object.
Otherwise you just have binary data in an unknow format. Perhaps it is
simply an actual copy of a file, say a JPG image, copied in its
entirety. In this case you would simply save off the field data to a
temp disk file. As long as you know the proper file extension for this
data your issue is solved.

FInally, it could simply be a blob of private data used by the App in an
unknow format. Heres some code to copy the contents of the current
record displayed in a Bound Object Frame control to a disk file. If this
temp file contains Text only then you can view it in Wordpad etc. If it
is a mixture of data types then you will need a HEX editor to view the
data. There are many freeware/shareware HEX editors on the Web.

Just add a CommandButton control to the form you created as per the
above instructions.

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) ' should be -1
' Copy the contents of the OLE field to our byte array
a = Me.olePicture.Value
sl = "OLEfieldTest" & ".dat"
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.
"Jerry" <le**********@nowhere.com> wrote in message
news:Xn**********************************@207.225. 159.6...
I have an off-the-shelf app that uses an Access database as its
backend. One of the tables contains a field with an "OLE Object"
datatype. I'm writing some reports against this database, and I
believe this field contains data I need. When I view the table in
datasheet view, all I can see in this field is the string "Long
binary data".

So, I've got the problem of needing to extract data from this
field, but I don't know what format the data is in, or how the app
inserts data to begin with. If I can extract the binary data
intact, I may be able to pick it apart and find what I need. I'm
looking for a solution that lets me get at the data for the whole
table, so an export of the whole table including the binary data
would be fine.

I'm not a VB or ASP coder, but if code is needed for this I can
probably copy code samples and make simple modifications to suit my
task. Is there any hope of extracting this data?


Nov 13 '05 #2
Hi Jerry,

Start by creating a form with a BoundObjectFrame bound to the OLE field.
This will usually let you see what the fields contain (typically in an
Access database they will contain something like an Excel workbook, an
image, or other application data, packaged with OLE header information
that often includes a preview image). If that's the case, the simplest
way to access the data within the object is to automate the
BoundObjectFrame; see e.g.:

ACC: How to Save a Copy of an Embedded MS Word Document
http://support.microsoft.com/id=?132003

ACC: Programmatically Link or Embed an Object in a Form (95/97)
http://support.microsoft.com/id=?158929
This article shows you how to programmatically link or embed an object
in an unbound object frame on a form by using the object frame
properties in Microsoft Access.

ACC2000: How to Embed a Bitmap Object in a Report at Run Time
http://support.microsoft.com/id=?198463
This article shows you how to use code to embed a bitmap image in a
report at run time. The example uses an image control instead of an OLE
object frame to store the bitmap. You can use Visual Basic for
Applications code to embed an OLE object into a...

ACC2000: How to Programmatically Link or Embed an Object on a Form
http://support.microsoft.com/id=?209990
This article shows you how to programmatically link or embed an object
in an unbound object frame on a form by using the object frame
properties in Microsoft Access.

How to embed a bitmap object in a report at run time in Access 2002
http://support.microsoft.com/id=?286459 - Explains how to use VBA code
to embed an OLE object into a control on a form at run time. You need to
se the Enabled property of the control to Yes and the Locked property to
No. In a report, you can embed bitmaps in an image control.

ACC2000: How to Embed a Bitmap Object in a Report at Run Time
http://support.microsoft.com/id=?198463
This article shows you how to use code to embed a bitmap image in a
report at run time. The example uses an image control instead of an OLE
object frame to store the bitmap. You can use Visual Basic for
Applications code to embed an OLE object into a

On Fri, 17 Jun 2005 17:47:42 GMT, Jerry <le**********@nowhere.com>
wrote:
I have an off-the-shelf app that uses an Access database as its
backend. One of the tables contains a field with an "OLE Object"
datatype. I'm writing some reports against this database, and I
believe this field contains data I need. When I view the table in
datasheet view, all I can see in this field is the string "Long
binary data".

So, I've got the problem of needing to extract data from this
field, but I don't know what format the data is in, or how the app
inserts data to begin with. If I can extract the binary data
intact, I may be able to pick it apart and find what I need. I'm
looking for a solution that lets me get at the data for the whole
table, so an export of the whole table including the binary data
would be fine.

I'm not a VB or ASP coder, but if code is needed for this I can
probably copy code samples and make simple modifications to suit my
task. Is there any hope of extracting this data?


--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
Nov 13 '05 #3
Thanks, Stephen. That helps tremendously, and I think I'm on the
right track. I created the form as you suggested, but I can't see
the data. This suggests (as I suspected) that the data is probably
in some proprietary format. That's fine, if I can still get at it.
I have a good hex editor ready to pick this apart.

I tried adding the CommandButton control with the code you
graciously offered, but I get an error: "Compile error: Method or
data member not found" occurs on the line "lTemp = LenB
(Me.olePicture.Value)" (specifically, the debugger highlights the
".olePicture" bit). I assume this means I don't have some library
loaded, or something like that. Do you know how I can resolve
this?

"Stephen Lebans"
<Fo****************************************@linval id.com> wrote in
news:Mk*********************@ursa-nb00s0.nbnet.nb.ca:
It depends whether the App inserted the data as an OLE object or
simply as data in some format.

Create a form bound to this table. Add a BOUND Object Frame
control bound to the OLE field in question.

Now open the form in Form view. If you can see the data and
interact with it then you have an OLE object.
Otherwise you just have binary data in an unknow format. Perhaps
it is simply an actual copy of a file, say a JPG image, copied
in its entirety. In this case you would simply save off the
field data to a temp disk file. As long as you know the proper
file extension for this data your issue is solved.

FInally, it could simply be a blob of private data used by the
App in an unknow format. Heres some code to copy the contents of
the current record displayed in a Bound Object Frame control to
a disk file. If this temp file contains Text only then you can
view it in Wordpad etc. If it is a mixture of data types then
you will need a HEX editor to view the data. There are many
freeware/shareware HEX editors on the Web.

Just add a CommandButton control to the form you created as per
the
above instructions.

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) ' should be -1
' Copy the contents of the OLE field to our byte array
a = Me.olePicture.Value
sl = "OLEfieldTest" & ".dat"
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.
"Jerry" <le**********@nowhere.com> wrote in message
news:Xn**********************************@207.225. 159.6...
I have an off-the-shelf app that uses an Access database as its
backend. One of the tables contains a field with an "OLE
Object" datatype. I'm writing some reports against this
database, and I believe this field contains data I need. When
I view the table in datasheet view, all I can see in this field
is the string "Long binary data".

So, I've got the problem of needing to extract data from this
field, but I don't know what format the data is in, or how the
app inserts data to begin with. If I can extract the binary
data intact, I may be able to pick it apart and find what I
need. I'm looking for a solution that lets me get at the data
for the whole table, so an export of the whole table including
the binary data would be fine.

I'm not a VB or ASP coder, but if code is needed for this I can
probably copy code samples and make simple modifications to
suit my task. Is there any hope of extracting this data?


Nov 13 '05 #4
Oops, sorry if that looks confusing - I'm the OP, but I'm borrowing
a neighbor's machine! :)

Peter <nm********************@nospam.com> wrote in
news:Xn**********************************@207.225. 159.6:
Thanks, Stephen. That helps tremendously, and I think I'm on
the right track. I created the form as you suggested, but I
can't see the data. This suggests (as I suspected) that the
data is probably in some proprietary format. That's fine, if I
can still get at it. I have a good hex editor ready to pick
this apart.

I tried adding the CommandButton control with the code you
graciously offered, but I get an error: "Compile error: Method
or data member not found" occurs on the line "lTemp = LenB
(Me.olePicture.Value)" (specifically, the debugger highlights
the ".olePicture" bit). I assume this means I don't have some
library loaded, or something like that. Do you know how I can
resolve this?

"Stephen Lebans"
<Fo****************************************@linval id.com> wrote
in news:Mk*********************@ursa-nb00s0.nbnet.nb.ca:
It depends whether the App inserted the data as an OLE object
or simply as data in some format.

Create a form bound to this table. Add a BOUND Object Frame
control bound to the OLE field in question.

Now open the form in Form view. If you can see the data and
interact with it then you have an OLE object.
Otherwise you just have binary data in an unknow format.
Perhaps it is simply an actual copy of a file, say a JPG image,
copied in its entirety. In this case you would simply save off
the field data to a temp disk file. As long as you know the
proper file extension for this data your issue is solved.

FInally, it could simply be a blob of private data used by the
App in an unknow format. Heres some code to copy the contents
of the current record displayed in a Bound Object Frame control
to a disk file. If this temp file contains Text only then you
can view it in Wordpad etc. If it is a mixture of data types
then you will need a HEX editor to view the data. There are
many freeware/shareware HEX editors on the Web.

Just add a CommandButton control to the form you created as
per the
above instructions.

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) ' should be -1
' Copy the contents of the OLE field to our byte array
a = Me.olePicture.Value
sl = "OLEfieldTest" & ".dat"
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.
"Jerry" <le**********@nowhere.com> wrote in message
news:Xn**********************************@207.225. 159.6...
I have an off-the-shelf app that uses an Access database as
its backend. One of the tables contains a field with an "OLE
Object" datatype. I'm writing some reports against this
database, and I believe this field contains data I need. When
I view the table in datasheet view, all I can see in this
field is the string "Long binary data".

So, I've got the problem of needing to extract data from this
field, but I don't know what format the data is in, or how the
app inserts data to begin with. If I can extract the binary
data intact, I may be able to pick it apart and find what I
need. I'm looking for a solution that lets me get at the data
for the whole table, so an export of the whole table including
the binary data would be fine.

I'm not a VB or ASP coder, but if code is needed for this I
can probably copy code samples and make simple modifications
to suit my task. Is there any hope of extracting this data?



Nov 13 '05 #5
You need to Substitute the name of your actual Bound Object Frame.
Me.olePicture.Value
to
Me.The NameOfYourBoundObjectFrameControl.Value

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Peter" <nm********************@nospam.com> wrote in message
news:Xn**********************************@207.225. 159.6...
Thanks, Stephen. That helps tremendously, and I think I'm on the
right track. I created the form as you suggested, but I can't see
the data. This suggests (as I suspected) that the data is probably
in some proprietary format. That's fine, if I can still get at it.
I have a good hex editor ready to pick this apart.

I tried adding the CommandButton control with the code you
graciously offered, but I get an error: "Compile error: Method or
data member not found" occurs on the line "lTemp = LenB
(Me.olePicture.Value)" (specifically, the debugger highlights the
".olePicture" bit). I assume this means I don't have some library
loaded, or something like that. Do you know how I can resolve
this?

"Stephen Lebans"
<Fo****************************************@linval id.com> wrote in
news:Mk*********************@ursa-nb00s0.nbnet.nb.ca:
It depends whether the App inserted the data as an OLE object or
simply as data in some format.

Create a form bound to this table. Add a BOUND Object Frame
control bound to the OLE field in question.

Now open the form in Form view. If you can see the data and
interact with it then you have an OLE object.
Otherwise you just have binary data in an unknow format. Perhaps
it is simply an actual copy of a file, say a JPG image, copied
in its entirety. In this case you would simply save off the
field data to a temp disk file. As long as you know the proper
file extension for this data your issue is solved.

FInally, it could simply be a blob of private data used by the
App in an unknow format. Heres some code to copy the contents of
the current record displayed in a Bound Object Frame control to
a disk file. If this temp file contains Text only then you can
view it in Wordpad etc. If it is a mixture of data types then
you will need a HEX editor to view the data. There are many
freeware/shareware HEX editors on the Web.

Just add a CommandButton control to the form you created as per
the
above instructions.

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) ' should be -1
' Copy the contents of the OLE field to our byte array
a = Me.olePicture.Value
sl = "OLEfieldTest" & ".dat"
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.
"Jerry" <le**********@nowhere.com> wrote in message
news:Xn**********************************@207.225. 159.6...
I have an off-the-shelf app that uses an Access database as its
backend. One of the tables contains a field with an "OLE
Object" datatype. I'm writing some reports against this
database, and I believe this field contains data I need. When
I view the table in datasheet view, all I can see in this field
is the string "Long binary data".

So, I've got the problem of needing to extract data from this
field, but I don't know what format the data is in, or how the
app inserts data to begin with. If I can extract the binary
data intact, I may be able to pick it apart and find what I
need. I'm looking for a solution that lets me get at the data
for the whole table, so an export of the whole table including
the binary data would be fine.

I'm not a VB or ASP coder, but if code is needed for this I can
probably copy code samples and make simple modifications to
suit my task. Is there any hope of extracting this data?


Nov 13 '05 #6
Sorry to be a dunce, but now I get the same error, but highlighting
the ".Value" part of the line. Is there a substitution I need for
that too?
"Stephen Lebans"
<Fo****************************************@linval id.com> wrote in
news:ab*********************@ursa-nb00s0.nbnet.nb.ca:
You need to Substitute the name of your actual Bound Object
Frame. Me.olePicture.Value
to
Me.The NameOfYourBoundObjectFrameControl.Value

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.

Nov 13 '05 #7
Scratch that, I figured it out. (I had substituted the name of the
command button, not the bound object frame.) This works, and it's
enough to let me start parsing through the data one record at a
time. Next I'll need to modify this to dump a bunch of records at
once, but I'll work on that as an exercise in VB coding (which I
sorely need). Thanks again for the help!

Jerry <le**********@nowhere.com> wrote in
news:Xn**********************************@207.225. 159.7:
Sorry to be a dunce, but now I get the same error, but
highlighting the ".Value" part of the line. Is there a
substitution I need for that too?
"Stephen Lebans"
<Fo****************************************@linval id.com> wrote
in news:ab*********************@ursa-nb00s0.nbnet.nb.ca:
You need to Substitute the name of your actual Bound Object
Frame. Me.olePicture.Value
to
Me.The NameOfYourBoundObjectFrameControl.Value

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


Nov 13 '05 #8


--
+----------+
| PLEASE |
| DO NOT | te*******@hotmail.com

"Jerry" <le**********@nowhere.com> wrote in message
news:Xn**********************************@207.225. 159.7... Scratch that, I figured it out. (I had substituted the name of the
command button, not the bound object frame.) This works, and it's
enough to let me start parsing through the data one record at a
time. Next I'll need to modify this to dump a bunch of records at
once, but I'll work on that as an exercise in VB coding (which I
sorely need). Thanks again for the help!

Jerry <le**********@nowhere.com> wrote in
news:Xn**********************************@207.225. 159.7:
Sorry to be a dunce, but now I get the same error, but
highlighting the ".Value" part of the line. Is there a
substitution I need for that too?
"Stephen Lebans"
<Fo****************************************@linval id.com> wrote
in news:ab*********************@ursa-nb00s0.nbnet.nb.ca:
You need to Substitute the name of your actual Bound Object
Frame. Me.olePicture.Value
to
Me.The NameOfYourBoundObjectFrameControl.Value

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.

Nov 13 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Steven K | last post by:
Hello, I am using an asp page (upload.asp) to gather information and to upload files to the web server using SoftArtisans SAUpload Tool. In the...
6
by: alederer | last post by:
Hallo! I have a table tstest(ts char(13) for bit data constraint a unique). This column is filled in a trigger with generate_unique(). In a...
2
by: Lucas Tam | last post by:
Hi all, I'm using ASP MasterPages for my templates. As such, I have a couple of pages which are for file uploads. Is there any drawbacks in...
1
by: Stimp | last post by:
I have an asp.net page with a form and several <INPUT type=fileinput fields so that I can upload images via the form. I also have about 30 other...
4
by: vunet.us | last post by:
Hi all, I am converting my app to AJAX-based. I have a form that submits some data including images. When I use AJAX XmlHttpRequest I am unable to...
2
ammoos
by: ammoos | last post by:
hi friends may i know the use of enctype="multipart/form-data" in the asp.net pages eg; <form enctype="multipart/form-data" runat="server"> ...
2
by: =?Utf-8?B?QWxleCBNYWdoZW4=?= | last post by:
I have a MasterPage. The MasterPage actually contains the <formtag which is used throughout the site. On just certain pages that use that...
1
by: walterbyrd | last post by:
I understand that Python has them, but PHP doesn't. I think that is because mod_php is built into apache, but mod_python is not usually in...
4
by: Rob | last post by:
I've got quite an already complex form to which I need to add a upload photo facility. I know how to do this but wondered if adding the form tag to...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.