-
Call COM Method from a trigger
Is there a way to instatiate a COM Component and use it in a Strored Proc / Trigger.
If anybody can help then I would be greatfull.
Thanks,
-
Call COM Method from a trigger (reply)
use sp_OACreate, sp_OASetProperty, sp_OAGetProperty, sp_OAMethod, sp_OADestroy
e.g.:
DECLARE @object int
DECLARE @hr int
/* for example a Word Document */
EXEC @hr = sp_OACreate 'Word.Document', @object OUT
IF @hr <> 0
BEGIN
EXEC sp_displayoaerrorinfo @object, @hr
RETURN
END
EXEC @hr = sp_OASetProperty @object, 'PropertyName', 'PropertyValue'
IF @hr <> 0
BEGIN
EXEC sp_displayoaerrorinfo @object, @hr
RETURN
END
EXEC @hr = sp_OAMethod @object, 'PropertyName', NULL, 'Parameter1Value', ...
IF @hr <> 0
BEGIN
EXEC sp_displayoaerrorinfo @object, @hr
RETURN
END
EXEC @hr = sp_OADestroy @object
IF @hr <> 0
BEGIN
EXEC sp_displayoaerrorinfo @object, @hr
RETURN
END
------------
arun at 1/7/2002 5:28:14 PM
Is there a way to instatiate a COM Component and use it in a Strored Proc / Trigger.
If anybody can help then I would be greatfull.
Thanks,
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|