Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Load/Save word docs from Powerbuilder

890 views
Skip to first unread message

Klaus

unread,
Sep 2, 2004, 5:34:06 AM9/2/04
to
Hi!

My database is created on Microsoft SQL server. In this
database word documents have been saved in a Image-column.

Now my question is if it from Powerbuilder somehow is
possible to load these documents from the database into
Microsoft Word and then save them as plain ordinary
Word-documents (docname.doc) in a folder outside the
database.

Any suggestions are welcome.

Cheers
Klaus

Andy Turiansky [TeamSybase]

unread,
Sep 2, 2004, 6:17:54 AM9/2/04
to
Basically, you will have to retrieve your document as ablob and then connect to
Word via OLE Automation and save the document

On 2 Sep 2004 02:34:06 -0700,
in sybase.public.powerbuilder.general

stonecold

unread,
Sep 2, 2004, 6:52:06 AM9/2/04
to
try this.. (ole_1 is an ole control)

BLOB b_doc

SELECTBLOB <image column>
INTO :b_doc
FROM table
WHERE id = 1
USING SQLCA;

ole_1.ObjectData = bdoc
OLEobject ole_object
ole_object = CREATE OLEobject
ole_1.Copy()

ls_connect = "word.application.8"
IF ole_object.ConnectToNewObject ( ls_connect ) = 0 THEN
ole_object.documents.add
ole_object.Selection.Paste
ole_object.ActiveDocument.SaveAs ("c:\doc.doc" )
ole_object.quit(0)
ole_object.DisconnectObject ( )
END IF

hope this helps!

JMR

unread,
Sep 2, 2004, 2:50:17 PM9/2/04
to
If the content of your image column is a word document, why
not read it with selectblob and user the fileWrite method to
write the doc file...?

hth,

JMR

0 new messages