Diagnosing OLE Automation Objects in Transact-SQL

Accessing and Changing Relational Data

Accessing and Changing Relational Data

Diagnosing OLE Automation Objects in Transact-SQL

When developing Transact-SQL batches that call custom OLE Automation objects, errors can occur in processing the data returned from the object. The problems can be diagnosed through Microsoft® Visual Basic® if the source code for the object is available. To do this, Visual Basic must be installed on the computer running the instance of Microsoft SQL Server™ 2000 and both SQL Server and Visual Basic must be running under the same Microsoft Windows® user account. SQL Server must be started from the command prompt and started independently of Windows Service Control Manager (by using the sqlservr /c command), or the SQL Server service must be started under the same Windows user account used to log on to the system.

When running Visual Basic and SQL Server under the same Windows user accounts:

  1. Load the custom OLE Automation server project into Visual Basic.

  2. Set breakpoint(s) on the desired lines of source code.

  3. On the Visual Basic Run menu, click Start With Full Compile.

    This registers and runs the custom OLE Automation server.

  4. Use the OLE Automation stored procedures to call the OLE objects exposed by the custom OLE Automation server.

    When a breakpoint is hit, the Visual Basic debugger is activated.

For more information, see the Microsoft Visual Basic documentation.