Microsoft KB Archive/310824

= ACC2002: Error Message: Application Roles Can Only Be Activated at the Ad Hoc Level =

Article ID: 310824

Article Last Modified on 9/25/2003

-

APPLIES TO


 * Microsoft Access 2002 Standard Edition

-



This article was previously published under Q310824



Advanced: Requires expert coding, interoperability, and multiuser skills.

This article applies only to a Microsoft Access project (.adp).



SYMPTOMS
When you try to execute the Microsoft SQL Server stored procedure sp_setapprole from a Microsoft Access project (ADP), you receive the following error message:

Application roles can only be activated at the ad hoc level.



CAUSE
You are executing the sp_setapprole stored procedure within the context of another stored procedure. By design, sp_setapprole cannot be executed if it is nested within another stored procedure.



Steps to Reproduce the Behavior
 Open the sample Access project NorthwindCS.adp, and connect it to Microsoft SQL Server 2000. In the Database window, click Queries under Objects, click New, click Create Text Stored Procedure, and then click OK to create a new stored procedure.  Replace the existing stored procedure text with the following text: CREATE PROCEDURE spMyProcedure AS EXEC sp_setapprole 'AppRoleName' ,'Password'  Save and run the stored procedure spMyProcedure. Note that you receive the error message that is mentioned in the &quot;Symptoms&quot; section of this article.

Additional query words: prb

Keywords: kberrmsg kbprb KB310824

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.