How to create an OLE Automation object (Transact-SQL)

How to Install SQL Server 2000

How To

How to create an OLE Automation object (Transact-SQL)

To create an OLE Automation object

  1. Call sp_OACreate to create the object.

  2. 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.
  3. 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

System Stored Procedures

Data Type Conversions Using OLE Automation Stored Procedures

How to debug a custom OLE Automation server (Transact-SQL)

OLE Automation Sample Script