linked ole objects in table

  • In our database we have a table with pdf documents linked as an ole object in a field. The field is not readable. We recently switched servers that the object is linked to. Is there a way to read this field and changed the path?

  • gisles (11/4/2016)


    In our database we have a table with pdf documents linked as an ole object in a field. The field is not readable. We recently switched servers that the object is linked to. Is there a way to read this field and changed the path?

    Is this in SQL Server? Which data type is the column?

    😎

  • I'll see if I can explain this better. The field in the table is an Image data type. The path of the pdf or excel is stored in this field. I need to convert this so I can find out the path. Is this possible? Below is an example of what the data in the field looks like. This is just one record.

    0x20000000000E0000706ACECFC74FCD01107DCAA9CF91CD010000000000000000D0CF11E0A1B11AE1000000000000000000000000000000003E000300FEFF0900060000000000000000000000010000000100000000000000001000000200000001000000FEFFFFFF0000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF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FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF52006F006F007400200045006E00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500FFFFFFFFFFFFFFFF010000000003000000000000C000000000000046000000000000000000000000107DCAA9CF91CD0103000000800500000000000001004F006C00650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000A000201FFFFFFFF02000000FFFFFFFF000000000000000000000000000000000000000000000000000000000000000000000000000000009A0300000000000002004F006C006500500072006500730030003000300000000000000000000000000000000000000000000000000000000000000000000000000000000000000018000200FFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000000000000000000000000000000000000F000000BA010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000002000000030000000400000005000000060000000700000008000000090000000A0000000B0000000C0000000D0000000E000000FEFFFFFF100000001100000012000000130000001400000015000000FEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0100000201000000030000000000000000000000000000004E0300000303000000000000C00000000000004600001E0000005C5C6763656E74315C61707065616C735C3230314143447E312E504446001000ADDE0000000000000000000000000000000002000000FA0200007600000003005C005C006700630065006E00740031005C00610070007000650061006C0073005C0032003000310032002000410050005000450041004C0020004C0045005400540045005200200046004F0052002000500041005200430045004C002000300031002D00300033003100340032002E007000640066007802000005004C0000000114020000000000C000000000000046830000002000000068CB66C1C74FCD01E83359CBC74FCD0128DCB7C1C74FCD0153DF000000000000010000000000000000000000000000005A0114001F58602C8D20EA3A6910A2D708002B30309D1400470002456E74697265204E6574776F726B0033004600824D6963726F736F66742057696E646F7773204E6574776F726B004D6963726F736F6674204E6574776F726B0002002800410082476C796E6E636F756E74792D6761004D6963726F736F6674204E6574776F726B00020022004200825C5C6763656E7431004D6963726F736F6674204E6574776F726B0002002B00C301C55C5C6763656E74315C61707065616C73004D6963726F736F6674204E6574776F726B000002008800320053DF0000D540C28020003230314143447E312E50444600006C0003000400EFBED540C280D540CA801400000032003000310032002000410050005000450041004C0020004C0045005400540045005200200046004F0052002000500041005200430045004C002000300031002D00300033003100340032002E0070006400660000001C0000006C0000001C0000000200000000000000000000001C0000004100000025000000020000001400000000000000000002005C5C4743454E54315C41505045414C5300323031322041505045414C204C455454455220464F522050415243454C2030312D30333134322E7064660060000000030000A058000000000000006763656E7431000000000000000000000284B09E83B2404E9E2E6B663F607CC1313A3D193592E111AE4C0013722D706A0284B09E83B2404E9E2E6B663F607CC1313A3D193592E111AE4C0013722D706A00000000FFFFFFFF65CA01B8FCA1D01185AD44455354000000000000FFFFFFFF0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFF030000000400000004000000FFFFFFFF0100000000000000EC090000C007000078010000010009000003BC00000001002A00000000000400000003010800050000000B0200000000050000000C024B00600005000000090200000000050000000102FFFFFF000A00000026060F00090049636F6E4F6E6C79000605000000090200000000050000000201010000001C000000FB02F5FF000000000000900100000001000000005461686F6D61000073130AA584D3120058B1F37761B1F3772040F57785126683040000002D010000050000002E010600000011000000320A240030000C0004000000000060004B00323031322041505045414C2019000000320A310030001C0004000000000060004B004C455454455220464F522050415243454C2030312D30333134322E70050000002E01010000002A00000026060F004A00433A5C57494E444F57535C496E7374616C6C65725C7B41433736424138362D374144372D313033332D374234342D4139353030303030303030317D5C50444646696C655F382E69636F000600000026060F00020030000300000000000000000000000000000000000000000000004E414E490000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FF00

  • It is sql server 2008 r2

  • gisles (11/10/2016)


    It is sql server 2008 r2

    Anything in the table that indicates the different file types? There is a great difference between pdf and xls, let alone the difference between different versions of pdf and Biff's (Excel file format).

    😎

    Question, as the Image data type is deprecated, any plans of changing it to varbinary?

  • We have a code we use to tell if it is a PDF or Excel. but after looking we have no excel files only pdf's.

  • I would be interested in changing the data type.

  • gisles (11/10/2016)


    I would be interested in changing the data type.

    That would be a good start;-)

    😎

    What you have there is an Object Linking and Embedding (OLE) Compound File (CF)

    ( Compound Binary File format ) for Microsoft Office 97-2003.

    Is the signature sequence in all entries?

    d0 cf 11 e0 a1 b1 1a e1

  • Yes, this is in all of them.

  • gisles (11/14/2016)


    Yes, this is in all of them.

    Manipulating the CF files in T-SQL is not trivial, the internal format is a FAT format which can be slightly twisted to work with. Suggest you look into other ways of doing this, i.e. a C# or a VB.net application.

    😎

  • Thanks, I am going to see what I can find.

Viewing 11 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic. Login to reply