Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6069163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:47:33+00:00 2026-05-23T09:47:33+00:00

I have this database with a table which has the the following but I

  • 0

I have this database with a table which has the the following but I have no way to decypher it

DATA,        TYPE,            FILE TYPE, SIZE,  DOC TYPE
0x15234324 , Word.Document.8 ,DOC,       19968, WORD.DOCUMENT.8

The field seems to contain a word document stored in a SQL Server IMAGE column

Has anyone come across this before or a way to extract this data in a readable format?

So far I have tried using PHP to extract the file and write it to a word document but not had much luck.

UPDATE: I now have Visual Studio Express and would like a way to extract this data and save to a word document

UPDATE2: This is what I have in VB sofar

Imports System.Data.SqlClient
Imports System.IO


Public Class Form1

    Private Shared Function RetrieveFile(ByVal filename As String) As Byte()
        Dim connection As New SqlConnection("Server=sqlsrv;database=database;Trusted_Connection=Yes;")
        Dim command As New SqlCommand("select data from objects where object_ref in (select data from parts where object_ref =239804)", connection)
        command.Parameters.AddWithValue("test", filename)
        connection.Open()
        Dim reader As SqlDataReader = command.ExecuteReader(System.Data.CommandBehavior.SequentialAccess)
        reader.Read()
        Dim memory As New MemoryStream()
        Dim startIndex As Long = 0
        Const ChunkSize As Integer = 256
        While True
            Dim buffer As Byte() = New Byte(ChunkSize - 1) {}
            Dim retrievedBytes As Long = reader.GetBytes(1, startIndex, buffer, 0, ChunkSize)
            memory.Write(buffer, 0, CInt(retrievedBytes))
            startIndex += retrievedBytes
            If retrievedBytes <> ChunkSize Then
                Exit While
            End If
        End While
        connection.Close()
        Dim data As Byte() = memory.ToArray()
        memory.Dispose()
        Return data


    End Function


    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim saveFileDialog1 As New SaveFileDialog()
        saveFileDialog1.Filter = "Doc File|*.doc"
        saveFileDialog1.Title = "Save an doc File"
        saveFileDialog1.ShowDialog()

        If saveFileDialog1.FileName <> "" Then
            Dim fs As New System.IO.FileStream(saveFileDialog1.FileName, System.IO.FileMode.Create, System.IO.FileAccess.Write)
            Dim data As Byte() = RetrieveFile("test.doc")
            fs.Write(data, 0, data.Length)
            fs.Flush()
            fs.Close()
        End If
    End Sub




End Class
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:47:34+00:00Added an answer on May 23, 2026 at 9:47 am

    I wrote a VBS script to pull data out of sharepoint blobs a while back, here’s a generic version of it:

    Const adOpenKeyset                  = 1
    Const adLockOptimistic              = 3
    Const adTypeBinary                  = 1
    Const adSaveCreateOverWrite         = 2
    
    strSQLServer = "YOURSERVER"
    strSQLDatabase = "YOURDB"
    strRecordID = "123"
    strTempFileName = "c:\output.doc"
    
    Set objConn = CreateObject("ADODB.Connection")
    Set objRS = CreateObject("ADODB.RecordSet")
    Set objStream = CreateObject("ADODB.Stream")
    
    objConn.Open "Provider=SQLOLEDB;data Source=" & strSQLServer & ";Initial Catalog=" & strSQLDatabase & "; Trusted_Connection=yes;"
    objRS.Open "Select * from AllDocStreams WHERE ID='" & strRecordID & "'", objConn, adOpenKeyset, adLockOptimistic
    
    objStream.Type = adTypeBinary
    objStream.Open
    objStream.Write objRS.Fields("Content").Value
    objStream.SaveToFile strTempFileName, adSaveCreateOverWrite
    
    objRS.Close
    objConn.Close
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a database application in which a group is modeled like this: TABLE
Consider we have a database that has a table, which is a record of
i have database table like this +-------+--------------+----------+ | id | ip | date |
I have a database table like this: id version_id field1 field2 1 1 texta
I have a database table using an enum. This is already working with hibernate
I have written a function to print database table to an array like this
I'm overthinking this. I have colors stored in a database table, and I want
I always forget how to do things like this. I have a database table
I have created a table on an Oracle 10g database with this structure :
I have a table in a MSSQL database that looks like this: Timestamp (datetime)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.