"Long binary data" in Access db

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jerry

    "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?


  • Stephen Lebans

    #2
    Re: "Long binary data" in Access db

    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_Cli ck


    Dim a() As Byte
    Dim lTemp As Long
    Dim sl As String


    lTemp = LenB(Me.olePict ure.Value)
    ReDim a(0 To lTemp) ' should be -1


    ' Copy the contents of the OLE field to our byte array
    a = Me.olePicture.V alue


    sl = "OLEfieldTe st" & ".dat"
    Open sl For Binary Access Write As #1
    Put #1, , a
    Close #1


    Exit_cmdSave_Cl ick:
    Exit Sub


    Err_cmdSave_Cli ck:
    MsgBox Err.Description
    Resume Exit_cmdSave_Cl ick


    End Sub




    --

    HTH
    Stephen Lebans

    Access Code, Tips and Tricks
    Please respond only to the newsgroups so everyone can benefit.


    "Jerry" <leavemealone@n owhere.com> wrote in message
    news:Xns96786DD 082A84leavemeal onenowherec@207 .225.159.6...[color=blue]
    > 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?
    >
    >[/color]

    Comment

    • John Nurick

      #3
      Re: &quot;Long binary data&quot; in Access db

      Hi Jerry,

      Start by creating a form with a BoundObjectFram e 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
      BoundObjectFram e; see e.g.:

      ACC: How to Save a Copy of an Embedded MS Word Document


      ACC: Programmaticall y Link or Embed an Object in a Form (95/97)

      This article shows you how to programmaticall y 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

      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 Programmaticall y Link or Embed an Object on a Form

      This article shows you how to programmaticall y 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

      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 <leavemealone@n owhere.com>
      wrote:
      [color=blue]
      >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?
      >[/color]

      --
      John Nurick [Microsoft Access MVP]

      Please respond in the newgroup and not by email.

      Comment

      • Peter

        #4
        Re: &quot;Long binary data&quot; in Access db

        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
        ".olePictur e" 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"
        <ForEmailGotoMy .WebSite.-WWWdotlebansdot com@linvalid.co m> wrote in
        news:MkGse.4856 1$Ph4.1280828@u rsa-nb00s0.nbnet.nb .ca:
        [color=blue]
        > 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_Cli ck
        >
        >
        > Dim a() As Byte
        > Dim lTemp As Long
        > Dim sl As String
        >
        >
        > lTemp = LenB(Me.olePict ure.Value)
        > ReDim a(0 To lTemp) ' should be -1
        >
        >
        > ' Copy the contents of the OLE field to our byte array
        > a = Me.olePicture.V alue
        >
        >
        > sl = "OLEfieldTe st" & ".dat"
        > Open sl For Binary Access Write As #1
        > Put #1, , a
        > Close #1
        >
        >
        > Exit_cmdSave_Cl ick:
        > Exit Sub
        >
        >
        > Err_cmdSave_Cli ck:
        > MsgBox Err.Description
        > Resume Exit_cmdSave_Cl ick
        >
        >
        > 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" <leavemealone@n owhere.com> wrote in message
        > news:Xns96786DD 082A84leavemeal onenowherec@207 .225.159.6...[color=green]
        >> 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?
        >>
        >>[/color]
        >[/color]

        Comment

        • Peter

          #5
          Re: &quot;Long binary data&quot; in Access db

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

          Peter <nmdba_at_yahoo _dot_com@nospam .com> wrote in
          news:Xns9678A49 7E7DB3nextmeddb anospamspam@207 .225.159.6:
          [color=blue]
          > 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 ".olePictur e" 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"
          > <ForEmailGotoMy .WebSite.-WWWdotlebansdot com@linvalid.co m> wrote
          > in news:MkGse.4856 1$Ph4.1280828@u rsa-nb00s0.nbnet.nb .ca:
          >[color=green]
          >> 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_Cli ck
          >>
          >>
          >> Dim a() As Byte
          >> Dim lTemp As Long
          >> Dim sl As String
          >>
          >>
          >> lTemp = LenB(Me.olePict ure.Value)
          >> ReDim a(0 To lTemp) ' should be -1
          >>
          >>
          >> ' Copy the contents of the OLE field to our byte array
          >> a = Me.olePicture.V alue
          >>
          >>
          >> sl = "OLEfieldTe st" & ".dat"
          >> Open sl For Binary Access Write As #1
          >> Put #1, , a
          >> Close #1
          >>
          >>
          >> Exit_cmdSave_Cl ick:
          >> Exit Sub
          >>
          >>
          >> Err_cmdSave_Cli ck:
          >> MsgBox Err.Description
          >> Resume Exit_cmdSave_Cl ick
          >>
          >>
          >> 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" <leavemealone@n owhere.com> wrote in message
          >> news:Xns96786DD 082A84leavemeal onenowherec@207 .225.159.6...[color=darkred]
          >>> 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?
          >>>
          >>>[/color]
          >>[/color]
          >
          >[/color]

          Comment

          • Stephen Lebans

            #6
            Re: &quot;Long binary data&quot; in Access db

            You need to Substitute the name of your actual Bound Object Frame.
            Me.olePicture.V alue
            to
            Me.The NameOfYourBound ObjectFrameCont rol.Value

            --

            HTH
            Stephen Lebans

            Access Code, Tips and Tricks
            Please respond only to the newsgroups so everyone can benefit.


            "Peter" <nmdba_at_yahoo _dot_com@nospam .com> wrote in message
            news:Xns9678A49 7E7DB3nextmeddb anospamspam@207 .225.159.6...[color=blue]
            > 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
            > ".olePictur e" 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"
            > <ForEmailGotoMy .WebSite.-WWWdotlebansdot com@linvalid.co m> wrote in
            > news:MkGse.4856 1$Ph4.1280828@u rsa-nb00s0.nbnet.nb .ca:
            >[color=green]
            > > 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_Cli ck
            > >
            > >
            > > Dim a() As Byte
            > > Dim lTemp As Long
            > > Dim sl As String
            > >
            > >
            > > lTemp = LenB(Me.olePict ure.Value)
            > > ReDim a(0 To lTemp) ' should be -1
            > >
            > >
            > > ' Copy the contents of the OLE field to our byte array
            > > a = Me.olePicture.V alue
            > >
            > >
            > > sl = "OLEfieldTe st" & ".dat"
            > > Open sl For Binary Access Write As #1
            > > Put #1, , a
            > > Close #1
            > >
            > >
            > > Exit_cmdSave_Cl ick:
            > > Exit Sub
            > >
            > >
            > > Err_cmdSave_Cli ck:
            > > MsgBox Err.Description
            > > Resume Exit_cmdSave_Cl ick
            > >
            > >
            > > 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" <leavemealone@n owhere.com> wrote in message
            > > news:Xns96786DD 082A84leavemeal onenowherec@207 .225.159.6...[color=darkred]
            > >> 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?
            > >>
            > >>[/color]
            > >[/color]
            >[/color]

            Comment

            • Jerry

              #7
              Re: &quot;Long binary data&quot; in Access db

              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"
              <ForEmailGotoMy .WebSite.-WWWdotlebansdot com@linvalid.co m> wrote in
              news:abJse.4863 9$Ph4.1284015@u rsa-nb00s0.nbnet.nb .ca:
              [color=blue]
              > You need to Substitute the name of your actual Bound Object
              > Frame. Me.olePicture.V alue
              > to
              > Me.The NameOfYourBound ObjectFrameCont rol.Value
              >
              > --
              >
              > HTH
              > Stephen Lebans
              > http://www.lebans.com
              > Access Code, Tips and Tricks
              > Please respond only to the newsgroups so everyone can benefit.
              >[/color]

              Comment

              • Jerry

                #8
                Re: &quot;Long binary data&quot; in Access db

                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 <leavemealone@n owhere.com> wrote in
                news:Xns967B709 FFB6DDleavemeal onenowherec@207 .225.159.7:
                [color=blue]
                > 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"
                > <ForEmailGotoMy .WebSite.-WWWdotlebansdot com@linvalid.co m> wrote
                > in news:abJse.4863 9$Ph4.1284015@u rsa-nb00s0.nbnet.nb .ca:
                >[color=green]
                >> You need to Substitute the name of your actual Bound Object
                >> Frame. Me.olePicture.V alue
                >> to
                >> Me.The NameOfYourBound ObjectFrameCont rol.Value
                >>
                >> --
                >>
                >> HTH
                >> Stephen Lebans
                >> http://www.lebans.com
                >> Access Code, Tips and Tricks
                >> Please respond only to the newsgroups so everyone can benefit.
                >>[/color][/color]

                Comment

                • i didnt say that

                  #9
                  Re: &quot;Long binary data&quot; in Access db



                  --[color=blue]
                  >+----------+
                  >| PLEASE |
                  >| DO NOT |[/color]
                  templeltd@hotma il.com
                  [color=blue]
                  >
                  >
                  >
                  >[/color]
                  "Jerry" <leavemealone@n owhere.com> wrote in message
                  news:Xns967B7B6 F34919leavemeal onenowherec@207 .225.159.7...[color=blue]
                  > 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 <leavemealone@n owhere.com> wrote in
                  > news:Xns967B709 FFB6DDleavemeal onenowherec@207 .225.159.7:
                  >[color=green]
                  > > 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"
                  > > <ForEmailGotoMy .WebSite.-WWWdotlebansdot com@linvalid.co m> wrote
                  > > in news:abJse.4863 9$Ph4.1284015@u rsa-nb00s0.nbnet.nb .ca:
                  > >[color=darkred]
                  > >> You need to Substitute the name of your actual Bound Object
                  > >> Frame. Me.olePicture.V alue
                  > >> to
                  > >> Me.The NameOfYourBound ObjectFrameCont rol.Value
                  > >>
                  > >> --
                  > >>
                  > >> HTH
                  > >> Stephen Lebans
                  > >> http://www.lebans.com
                  > >> Access Code, Tips and Tricks
                  > >> Please respond only to the newsgroups so everyone can benefit.
                  > >>[/color][/color]
                  >[/color]


                  Comment

                  Working...