How to debug a custom OLE Automation server (Transact-SQL)
You can debug a custom OLE Automation server created by using 32-bit Microsoft® Visual Basic® version 4.0. To do this, Visual Basic must be installed on the Microsoft SQL Server™ computer, and SQL Server must be running under the same Microsoft Windows NT® user account as Visual Basic. SQL Server must be started from the command prompt and independently of the Windows NT Service Control Manager (by using the sqlservr /c command), or the SQL Server service must be started under the same Windows NT user account used to log on to the system.
To debug a custom OLE Automation server
- Load your custom OLE Automation server project into Visual Basic.
- Set breakpoint(s) on the desired lines of source code.
- On the Run menu, click Start With Full Compile.
This registers and runs your custom OLE Automation server.
- Use the OLE Automation stored procedures to call the OLE objects exposed by your custom OLE Automation server.
When a breakpoint is hit, the Visual Basic debugger is activated.
For more information, see your documentation for Visual Basic.
A custom, in-process OLE server, created using 32-bit Visual Basic 4.0, must have an error handler (specified with the On Error GoTo statement) for the Class_Initialize and Class_Terminate subroutines. The error handlers will prevent unhandled errors from occurring in the subroutines. Unhandled errors in the Class_Initialize and Class_Terminate subroutines can cause unpredictable SQL Server problems, such as a SQL Server access violation. Error handlers for other subroutines are also recommended.