Role activation

From: Darko Grujic (darkogrujic@hotmail.com)
Date: 03/27/03


From: "Darko Grujic" <darkogrujic@hotmail.com>
Date: Thu, 27 Mar 2003 03:59:53 -0800


I can activate an application role using Query Analyzer
with EXEC sp_setapprole "RoleName", "RolePassword"
but not using VBA from within Excel or from within another
application:

 Dim oConnection As ADODB.Connection
' Create the connection object and connect.
Set oConnection = CreateObject("ADODB.Connection")
oConnection.Provider = "sqloledb"
oConnection.Open "Server=SERVERNAME;Database=pubs;Trusted_C
onnection=yes"

' Activate the application role. There is no error
handling for this sample.
oConnection.Execute "EXEC
sp_setapprole 'AccAppRole', 'ABC'"

This runs with no errors, all libraries exist, but the
role does not get activated.



Relevant Pages

  • Re: MailMerge API Trouble
    ... it may be possible to do this test without Excel) ... word doc set up using themailmergewizard that creates an SQL ... there is an exec sp_cursoropen ... I am running SQL Server 2000 sp4, my client is ...
    (microsoft.public.word.vba.general)
  • SQL Command Line Consolidation
    ... Excel current worksheet sample: ... SQL current table sample: ... EXEC sp_addlinkedsrvlogin 'ExcelSource', 'false' ...
    (microsoft.public.sqlserver.msde)
  • Joining Excel Database with MSDE Database Table, & Import
    ... Excel current worksheet sample: ... SQL current table sample: ... EXEC sp_addlinkedsrvlogin 'ExcelSource', 'false' ...
    (microsoft.public.sqlserver.msde)
  • SQL Command Line Consolidation
    ... Excel current worksheet sample: ... SQL current table sample: ... EXEC sp_addlinkedsrvlogin 'ExcelSource', 'false' ...
    (microsoft.public.sqlserver.server)
  • Joining Excel Database with MSDE Database Table, & Import
    ... Excel current worksheet sample: ... SQL current table sample: ... EXEC sp_addlinkedsrvlogin 'ExcelSource', 'false' ...
    (microsoft.public.sqlserver.server)