J
Jonathan Allen
Is this the correct way to use application roles?
Public Function GetDBConnection() As SqlConnection
Dim oCon As New SqlConnection(myConnectionString)
oCon.Open()
Using oCmd As SqlCommand = oCon.CreateCommand
oCmd.CommandText = "IF NOT User_NAME() = 'app_name' Exec
sp_setapprole 'app_name' ,'password"
oCmd.ExecuteNonQuery()
End Using
Return oCon
What is a good way to embed/encrypt the application role's password in the
program?
Public Function GetDBConnection() As SqlConnection
Dim oCon As New SqlConnection(myConnectionString)
oCon.Open()
Using oCmd As SqlCommand = oCon.CreateCommand
oCmd.CommandText = "IF NOT User_NAME() = 'app_name' Exec
sp_setapprole 'app_name' ,'password"
oCmd.ExecuteNonQuery()
End Using
Return oCon
What is a good way to embed/encrypt the application role's password in the
program?