The information in this article applies to:
SUMMARYThis article provides tips for debugging OLE DB Providers which are called from SQL Server version 7.0. Moreover, SQL Server 7.0 can perform distributed queries by using the OPENROWSET and OPENQUERY Transact SQL functions. MORE INFORMATIONSpecify that the OLE DB Provider is to be Loaded in the SQL Server Process Space.By default, an OLE DB Provider is invoked by SQL Server as an out-of-process component. This is done by using proxy/stub code in Msdaps.dll which is provided with the OLE DB core components. The OLE DB provider is hosted by using Dllhost.exe and is the surrogate process for the OLE DB Provider. Because it is difficult to attach to the Dllhost.exe process with the Visual C++ debugger, it is recommended that you mark the provider as in-process for debugging purposes. You can then attach the debugger to the SQL Server process Sqlservr.exe.To mark a provider as in-process, use one of the following two processes:
Attach the Debugger to the SQL Server ProcessThis can be done by going to Build. Click Start. Select Debug and click Attach to Process in the Visual C++ development environment. When the process list displays, select Show System Processes and you should see SQLSERVR appear in the list. This is the SQL Server process. Select it and the debugger will attach to the process. Go to Project then click Settings and select the Debug tab and add your OLE DB Provider DLL to the list of additional DLLs. This causes the debug information for your DLL to be loaded so breakpoints can be set in your OLE DB Provider source code.Debugging Providers which are Invoked Out-of-ProcessOccasionally, a problem will occur only when an OLE DB Provider is invoked out-of-process. By default, SQL server invokes OLE DB Providers out-of-process. This can be changed by using the steps described earlier in this article. However, if you must debug a problem which only occurs when the provider is out-of-process, you need to have a way to attach the debugger to the component. Following are a couple of ways to accomplish this:
Enable OLE DB Tracing in Query AnalyzerYou can have OLE DB trace information returned in Query Analyzer by typing the command: DBCC traceon(7300). After executing a distributed query, if the provider returned an error, diagnostic information will be displayed in the results window.Enable OLE DB Tracing in SQL Server ProfilerThe SQL Server Profiler application also provides diagnostic traces for OLE DB calls. To get information about OLE DB errors and warnings, do the following:
REFERENCESFor additional information, see the Support WebCast at the following location: http://support.microsoft.com/servicedesks/webcasts/wc102699/WC102699.asp Additional query words:
Keywords : kbDatabase kbOLEDB kbProvider kbSQLServ kbATL300 kbGrpVCDB |
Last Reviewed: January 28, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |