Wednesday, March 7, 2012

Application Role

after i create the application role, how do i make the application use this
role
in other words , how do i assign the application to this role '
--
regards
Maidoo.maido
Do you mean how to activate the application role within VB aplication?
"maidoo" <maidooalex@.msn.com> wrote in message
news:028CA4C1-55CB-4819-A2BA-BB6B8CC48B60@.microsoft.com...
> after i create the application role, how do i make the application use
this
> role
> in other words , how do i assign the application to this role '
> --
> regards
> Maidoo.
>|||actually, i don't know the step taken after creating this role , do i
activate it from the application, or there's something in the SQl Server
that let me assign this role to an application (exe file or something
like that )
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!|||Hi
Yes , you will have to activate it from the application.
Private Sub Form_Load()
Dim strConnect As String
Dim db_username As ADODB.Recordset
Dim ss As String
Dim pp As String, toto As String
pp = "pp"
toto = "toto"
Set cnAdo = New ADODB.Connection
strConnect = "driver={SQL
Server};uid=uri_test;pwd=tennis;server=S
erverName;database=databasename;Netw
ork=dbmssocn"
cnAdo.Provider = "SQLOLEDB"
cnAdo.ConnectionString = strConnect
cnAdo.CommandTimeout = 30 '10
cnAdo.CursorLocation = adUseServer
cnAdo.Mode = adModeRead
cnAdo.Open
' user_appl_role and user_appl_pwd are corect
cnAdo.Execute "EXEC sp_setapprole '" & pp & " ', '" & toto & "'"
Set db_username = New Recordset
sqlcommand = "select user_name ()"
db_username.CursorType = adOpenKeyset
db_username.LockType = adLockReadOnly
db_username.Open sqlcommand, cnAdo
db_username_role = db_username.Fields.Item(0).Value
' the result of these select is the correct name of the application role
End Sub
"Maidoo oriky" <maidooalex@.msn.com> wrote in message
news:%2368vAA88EHA.2552@.TK2MSFTNGP09.phx.gbl...
>
> actually, i don't know the step taken after creating this role , do i
> activate it from the application, or there's something in the SQl Server
> that let me assign this role to an application (exe file or something
> like that )
>
> *** Sent via Developersdex http://www.codecomments.com ***
> Don't just participate in USENET...get rewarded for it!|||thnx 4 ur help
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!

No comments:

Post a Comment