Symptoms
When you start Business Portal, you may receive the following error message:
Server Error in '/' Application. --------------------------------------------------------------------------------
SELECT permission denied on object 'MbfSubscription', database 'DYNAMICS', owner 'dbo'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: SELECT permission denied on object 'MbfSubscription', database 'DYNAMICS', owner 'dbo'.
Cause
This problem occurs if the BFGROUP database role does not have appropriate permissions for Business Portal objects.
Resolution
To resolve this problem, run the following script. This script assigns the appropriate permissions to the BFGROUP database role.
Notes
-
If you are running Business Portal together with Microsoft Dynamics GP, back up the DYNAMICS database and all company databases. Next, run the script against the DYNAMICS database and all company databases.
-
If you are running Business Portal together with Microsoft Dynamics SL, back up the system database and all application databases. Next, run the script against the system database and all application databases.
-
Run the script in Query Analyzer. To do this, click Start, point to Programs, point to Microsoft SQL Server, and then click Query Analyzer.
/*Count : 1 */
declare @cStatement varchar(255)
declare G_cursor CURSOR for select 'grant select,update,insert,delete on [' + convert(varchar(64),name) + '] to BFGROUP' from sysobjects
where (type = 'U' or type = 'V') and uid = 1
set nocount on
OPEN G_cursor
FETCH NEXT FROM G_cursor INTO @cStatement
WHILE (@@FETCH_STATUS <> -1)
begin
EXEC (@cStatement)
FETCH NEXT FROM G_cursor INTO @cStatement
end
DEALLOCATE G_cursor
declare G_cursor CURSOR for select 'grant execute on [' + convert(varchar(64),name) + '] to BFGROUP' from sysobjects
where type = 'P'
set nocount on
OPEN G_cursor
FETCH NEXT FROM G_cursor INTO @cStatement
WHILE (@@FETCH_STATUS <> -1)
begin
EXEC (@cStatement)
FETCH NEXT FROM G_cursor INTO @cStatement
end
DEALLOCATE G_cursor