browse: forums | FAQ
Connecting Tech Pros Worldwide

Hey there! Do you need Microsoft SQL Server help?

Get answers from our community of Microsoft SQL Server experts on BYTES! It's free.

Storing Unsaved Word Documents as BLOBs

David Horowitz
Guest
 
Posts: n/a
#1: Jul 20 '05
Hi folks,

I want to be able to store and retrieve UNSAVED Word documents as BLOBs. I
got all the info for storing them if they're already saved on the file
system. But what if they're not already saved? I could save them to a temp
file first and then make it a blob, but I'd rather not put them on the file
system at all. I could use Document.Contents to get the Range object for the
whole doc and then BLOB that, but I'm not sure that would be quite the same
as a .doc file, maybe things like Styles and the like would be missing.

TIA!

Dave





David Horowitz
Guest
 
Posts: n/a
#2: Jul 20 '05

re: Storing Unsaved Word Documents as BLOBs


And a related question -- even if I were to store them from the file system
(using code like in
http://support.microsoft.com/default...b;en-us;258038) how do I
tell the DB (Access in my case, but SQL Server should be the same), that the
BLOB is a Word object? Even when I use the instructions in the KB article, I
get (in Access) a type of "Long Binary Data", whereas if I use the Access
front-end to insert the object, when I view the table later, the type shows
"Microsoft Word Document"...

Thanks!

Dave

"David Horowitz" <dhorowitz@hhandf.com> wrote in message
news:Byfhb.23524$Ri4.9663442@news4.srv.hcvlny.cv.n et...
Hi folks,

I want to be able to store and retrieve UNSAVED Word documents as BLOBs. I
got all the info for storing them if they're already saved on the file
system. But what if they're not already saved? I could save them to a temp
file first and then make it a blob, but I'd rather not put them on the file
system at all. I could use Document.Contents to get the Range object for the
whole doc and then BLOB that, but I'm not sure that would be quite the same
as a .doc file, maybe things like Styles and the like would be missing.

TIA!

Dave



Erland Sommarskog
Guest
 
Posts: n/a
#3: Jul 20 '05

re: Storing Unsaved Word Documents as BLOBs


David Horowitz (dhorowitz@hhandf.com) writes:[color=blue]
> And a related question -- even if I were to store them from the file
> system (using code like in
> http://support.microsoft.com/default...b;en-us;258038) how do I
> tell the DB (Access in my case, but SQL Server should be the same), that
> the BLOB is a Word object? Even when I use the instructions in the KB
> article, I get (in Access) a type of "Long Binary Data", whereas if I
> use the Access front-end to insert the object, when I view the table
> later, the type shows "Microsoft Word Document"...[/color]

I cannot answer for Access, but in SQL Server there is no way you can
get the server itself to keep track of what you have put into an
image column. It is just a bunch of bytes.

You can of course add an extra column to keep track of which object it
is.

--
Erland Sommarskog, SQL Server MVP, sommar@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Closed Thread