Re: Saving image data type record to computer

From: Chuck (no.one_at_no.where)
Date: 02/06/05


Date: Sun, 6 Feb 2005 05:37:47 -0500

John,

You learn something new everyday! As I was researching this problem, the
word BLOB kept coming up. You mention it in your post as well. This is the
first time I have heard of this term so I looked it up:

Portion of Microsoft Article:
"From a database perspective, a binary data object is known as a binary
large object, or BLOB. As the acronym suggests, this type of data can take
up a lot of space. Using the image, text, or ntext data types, SQL Server
can store binary data in tables. Table 1, page 32, lists the attributes of
the data types that SQL Server can use for BLOB storage. The image data
type is the primary BLOB-storage data type; you can use it to hold virtually
any type of binary data."

>From that definition, I would say that the image data type I'm using is a
BLOB field....bit I'm not sure. In any case I guess it would be much
simpler if I save the word doc as a binary data type instead of image. That
means I lose the drag-and-drop functionality and will need to import the
document with code. Not ideal but workable.

Thanks again.

Chuck

"John Nurick" <j.mapSoN.nurick@dial.pipex.com> wrote in message
news:ufga01tdf0mckg9g38ndhbso9tpv10r108@4ax.com...
> Hi Chuck,
>
> When I answered your previous question I assumed you intended to store
> the contents of the Word documents in a BLOB field in a SQL Server
> table. But from what you're saying about an "image type object" I guess
> you're thinking in terms of embedding the document in an OLE field (or
> whatever the SQL Server equivalent is). The difference is that if you
> embed the document you don't just store the contents of the file but a
> package that also contains information about its parent app, an icon
> and/or picture of the first page, and so on. This means that if you
> write the contents of the field to disk, you don't get a usable
> document.
>
> I don't know what facilities are offered by ADP+SQL Server, but with
> MDB+Jet the least inconvenient way to access an embedded document is to
> use an ObjectFrame control on a form. By manipulating the Verb and
> Action properties of the ObjectFrame you can open the document in its
> parent application, either within the frame or in a separate window. IOW
> you can open the document without having to save it to disk - but if you
> do want to save it to disk you have to do it by automating the parent
> application.
>
> On Sat, 5 Feb 2005 11:25:03 -0500, "Chuck" <no.one@no.where> wrote:
>
>>On 2-4-2005 9:05, I asked how I could open an image file ( a Word document
>>actually) from an SQL table with VBA code. This would be similar to
>>opening
>>the table, right-clicking the record and choosing the "Document Object |
>>Open" menu item.
>>
>>I got one response saying that that is probably not possible and after
>>searching for quite a while, I would probably have to agree.
>>
>>So I guess I would have to save the file to the user's computer first and
>>then open it with Word automation. I have found code that works to save a
>>binary data type to the desktop (see below) but it does not work with an
>>image type, at least not when the image type is a Word document. The file
>>saved to the computer is not readable by Word. So how can I save an image
>>type object to the desktop (from an ADP project with SQL backend using
>>ADO)?
>>Thanks
>>
>>I guess I could save the Word file as a binary data type but I would
>>prefer
>>to use an image type since I can simply drag-and-drop the document into
>>the
>>table. I can't do that with a binary data type.
>>
>> ' Code to save binary record to computer.
>>Set BinaryStream = CreateObject("ADODB.Stream")
>>BinaryStream.Type = adTypeBinary
>>BinaryStream.Open
>>BinaryStream.Write Request.BinaryRead(Request.TotalBytes)
>>BinaryStream.SaveToFile "c:\myfile.doc", adSaveCreateOverWrite
>>
>
> --
> John Nurick [Microsoft Access MVP]
>
> Please respond in the newgroup and not by email.



Relevant Pages

  • Re: Blob field
    ... What data type should I use in SQL Server 2000 to define BLOB? ... AStream:= TMemoryStream.Create; ...
    (borland.public.delphi.database.ado)
  • Re: Datatype for storing scanned image ?
    ... "Patrick" wrote in message ... like to know what data type should we use? ... Is it the same for both SQL Server 2005 and SQL Server 2008. ... Someone has suggested storing the image as "Binary Data". ...
    (microsoft.public.sqlserver.server)
  • Re: using BLOB objects and ...
    ... Example on storing images into BLOB data type. ... - Managing SQL 92 data types (BLOB, CLOB and Ref) ...
    (comp.lang.java.programmer)
  • Re: using BLOB objects and ...
    ... Example on storing images into BLOB data type. ... - Managing SQL 92 data types (BLOB, CLOB and Ref) ...
    (comp.lang.java.programmer)
  • Re: Copying string to byte array
    ... Actually, no, there were no problems handling binary data before VB4. ... $tring data type was the documented and well established way to do that. ... Whether you know it, if Jim Mack gave you an opinion you got ...
    (microsoft.public.vb.general.discussion)

Loading