How to create an OLE Automation object (Transact-SQL)
To create an OLE Automation object
- Call sp_OACreate to create the object.
- Use the object.
- Call sp_OAGetProperty to get a property value.
- Call sp_OASetProperty to set a property to a new value.
- Call sp_OAMethod to call a method.
- Call sp_OAGetErrorInfo to get the most recent error information.
- Call sp_OAGetProperty to get a property value.
- Call sp_OADestroy to destroy the object.
Note All of these steps must be performed within a single Transact-SQL statement batch. All created OLE objects are destroyed automatically at the end of each statement batch.
See Also
Data Type Conversions Using OLE Automation Stored Procedures