.NET Questions and Solutions

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries Tagged ‘instance’

BUG: You may receive an “Access is denied” error message when a query calls an extended stored procedure after you upgrade from SQL Server 2000 to SQL Server 2000 Service Pack 4

Symptoms
After you upgrade a Microsoft SQL Server 2000-based computer to Microsoft SQL Server 2000 Service Pack 4 (SP4), a SQL Server query that calls a registry extended stored procedure may fail, and you receive the following error message:

Access is denied.You receive the error message when you use any one of the registry extended stored procedures in the following list: xp_regreadxp_instance_regreadxp_regenumkeysxp_instance_regenumkeysxp_regenumvaluesxp_instance_regenumvaluesxp_regwritexp_instance_regwritexp_regaddmultistringxp_instance_regaddmultistringxp_regremovemultistringxp_instance_regremovemultistringxp_regdeletevaluexp_instance_regdeletevaluexp_regdeletekeyxp_instance_regdeletekey
Resolution
This problem occurs because SQL Server 2000 SP4 implements a restriction on which registry paths the registry extended stored procedures can access. When a query calls a registry extended stored procedure, the registry extended stored procedure examines the requested registry subkey against a control list of registry hives. If the registry subkey that the query requests is not in the control list, you receive the following error message:

‘Access is denied.’ This error message has nothing to do with the permissions of the SQL Server user account in the context of which one of these registry extended stored procedures is called. The error message occurs even if the user has Administrator permissions.
Note When you receive the error message, the registry extended stored procedure returns no results.

BUG: Starting Word Manually Uses Same Instance as Automation

Symptoms
You run a Visual Basic application that uses the CreateObject function tostart a hidden instance of Microsoft Word. The application is idle, but itstill maintains a reference to Word. Next, you manually start an instanceof Word. A separate instance of Word should open, but the same instancethat was created by the Visual Basic application is made active instead. Ifyou close Word and continue to work in the Visual Basic application, one of the following errors occurs when the application tries to use Word objectsbecause Word is no longer running:

Run-time error ‘462′:
The remote server machine does not exist or is unavailable
-or-

Run-time error ‘-2147023174 (800706ba)’:
Automation errorThis automation error translates to “The RPC server is unavailable.”
Resolution
Use one of the following to work around this problem:Before you create your Word object, first create a temporary Wordobject. After you create your object, close the temporary object. Thiscauses Word to act properly when you control it through Automation (thatis, if a user interactively starts Word, a new instance of Word isopened for the user). The automation instance remains hidden andseparate. See the Steps to Reproduce Behavior section for an example ofthis workaround.Make the Word object visible immediately after using the CreateObjectfunction. This workaround is only for Microsoft Word 97. For example:

Set wrdApp = CreateObject(“Word.Application”)wrdApp.Visible = True