-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGetUserSetting
39 lines (38 loc) · 1.25 KB
/
GetUserSetting
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Public Function GetUserSetting( _
cn As ADODB.Connection, _
strSettingName As String _
) As Variant
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'DATE AUTHOR
'10/25/18 Alejandro
'
'PURPOSE
'Returns the value of a user setting by name.
'
'PARAMETERS
' cn Connection to use
' strSettingName Name of the setting for which to return the value
'
'TICKETS
'Date Ticket Description
'10/25/18 NHITAP-41 Create credit card purchase expensing tool
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Select and cast the setting
Dim strSQL As String
strSQL = "EXECUTE dbo.spSelectAndCastUserSetting " & FormatTextForQueries(strSettingName, True)
Dim rst As ADODB.Recordset
Set rst = CreateConnectionRecordset(cn, strSQL)
'Return the setting
If rst.State = ObjectStateEnum.adStateOpen Then
'If nothing was selected, return Null
If rst.EOF Then
GetUserSetting = Null
'Otherwise, return the setting
Else
GetUserSetting = rst(0)
End If
'If nothing was selected, return Null
Else
GetUserSetting = Null
End If
End Function