Hi All
Hoping someone can help.
I would like to create a stored procedure in SQL server which I can call from an access front-end application to determine what the role of the logged in user is to allow me to enable / disable application controls based on roles.
I have the following code:
Option Compare Database
Dim myString As String
Function GetRole() As String
Dim cmd As New ADODB.Command
Dim rs As New ADODB.Recordset
With cmd
.ActiveConnection = CurrentProject.Connection
.CommandType = adCmdStoredProc
.CommandText = "sp_CheckRole"
End With
Set rs = cmd.Execute
GetRole = rs!Role
Set cmd = Nothing
Set rs = Nothing
End Function
Private Sub Form_Load()
myString = GetRole()
End Sub
What I would like to know is what is the syntax I should use in the stored procedure ( here i called it sp_CheckRole ) to pass the role back to the myString variable.
Any help would be greatly appreciated.
Hoping someone can help.
I would like to create a stored procedure in SQL server which I can call from an access front-end application to determine what the role of the logged in user is to allow me to enable / disable application controls based on roles.
I have the following code:
Option Compare Database
Dim myString As String
Function GetRole() As String
Dim cmd As New ADODB.Command
Dim rs As New ADODB.Recordset
With cmd
.ActiveConnection = CurrentProject.Connection
.CommandType = adCmdStoredProc
.CommandText = "sp_CheckRole"
End With
Set rs = cmd.Execute
GetRole = rs!Role
Set cmd = Nothing
Set rs = Nothing
End Function
Private Sub Form_Load()
myString = GetRole()
End Sub
What I would like to know is what is the syntax I should use in the stored procedure ( here i called it sp_CheckRole ) to pass the role back to the myString variable.
Any help would be greatly appreciated.