Forms 5.0 with OLE to store Worddocument

From: <eugennyffeler_at_netscape.net>
Date: Tue, 09 Feb 1999 08:50:14 GMT
Message-ID: <79oss4$mqu$1_at_nnrp1.dejanews.com>



We have the following problem:

A multi row-form with one ole-container (word-document) and several display_items per row.
The ole-container corresponds to a DB-field (long raw).

The when-mouse-doubleclick trigger for the ole-container has the following code:

>> DECLARE
>> v_ole_id ITEM;
>> BEGIN
>> <snip the part of the permission tests>
>> v_ole_id := find_item (:system.cursor_item);
>> --
>> if (forms_ole.server_active(v_ole_id) = FALSE) then
>> forms_ole.activate_server (v_ole_id);
>> end if;
>> --
>> forms_ole.exec_verb (v_ole_id, 'Edit');
>> EXCEPTION
>> when OTHERS then
>> message (SQLERRM);
>> END;
The user has the right to read or modify a document.

With the code shown above, it's not possible to prevent a user from changing the doc (when he has only read-permission) in the word application. I tried to do the exec_verb once with 'Edit' and once with 'Open' but there was no difference (the user was always able to change the doc).

If the user opens a document (by double click) forms_ole or forms marks the record as changed. After the Word is closed the record is once again flagged as changed, even when the user hasn't done any changes! I'm able to change the record-status in a when-validate-trigger (or "any" other trigger), so that the "changed"-document (for which the user hasn't any modify rights) isn't written to the db. The BIG problem is that the "changed"-document is still available in the user-form till he makes a re query. I would like to overwrite the "changed"-document with the original contents, or prevent word from writing back to forms, to solve this problem. But i have no idea how i should do this. i thought about the database_value in the get_item_property function, but you can't handle long raw fields.

I tried also to protect/unprotect the document, but couldn't find a way to test if the doc is already unprotected/protected, and if i did unprotect when the doc was already unprotected i got a non-oracle-error (same with protect).

So has anybody out there any idea how to solve this problem ?

cc's to
voesystem_at_compuserve.com;andre.voegelin_at_pharma.novartis.com;eugennyffeler_at_net sca pe.net are really appreciated

TIA
eugen

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Tue Feb 09 1999 - 09:50:14 CET

Original text of this message