-
Notifications
You must be signed in to change notification settings - Fork 3
/
M_omStartup.def
106 lines (100 loc) · 4.98 KB
/
M_omStartup.def
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
Option Compare Database
Option Explicit
' Code written by Raoul Jacobs
' E. jara@opmaat.be
' Date Craeted : 201112
Public Function Main(Optional linkLocal As Boolean = False) As Integer
Dim FormName As String
omUserFunctions.AuthenticateUser
'omUserFunctions.UserLock
omMSAccessFunctions.MinimizeNavigationPane
'Stop
FormName = "Flow"
If NotIsNullOrEmpty(Command()) Then
If omStringFunctions.ParseValue(Trim(Command()), "OpenScreen") = "magazijn" Then
FormName = "StockCheck_List"
End If
End If
If gUser.UserRole.Name = "User" Then
FormName = "Project_List"
End If
DoCmd.OpenForm FormName
End Function
Public Function LinkAccessDatabase() As Variant
omSSMAAConnector.LinkMSAccess False
End Function
Public Function LinkSSMADatabase() As Variant
omSSMAAConnector.LinkUsingSSMA SavePassword:=True, alwaysUpdate:=True
End Function
Public Function LinkSSMADatabaseSQLODBC() As Variant
omSSMAAConnector.LinkUsingSSMA ConnectionType:=SQLODBC_Deprecated, SavePassword:=True, alwaysUpdate:=True
End Function
'Public Function SyncUserMain() As Boolean
'Dim LastSyncUser As Variant
'Dim makeConnection As Boolean
' 'omSSMAAConnector.LinkUsingSSMA ConnectionType:=Default, alwaysUpdate:=True
' gLogging.Enabled = True
' Application.SetOption "Move after enter", 0
' Application.SetOption "Auto compact", False
' If InStr(1, CurrentProject.Name, "mbi_client") > 0 Then
'
' gLogging.WriteToFile Description:="Startup > Main > mBI_Client=true"
' omSSMAAConnector.UpdateSSMAConnectionString Group:="mBIClientUser"
' gLogging.WriteToFile Description:="Startup > Main > mBI_Client=true > UpdateSSMAConnectionString for mBIClientUser"
'
' LastSyncUser = omDefaultFunctions.GetSystemDefault("LastSyncUser")
' gLogging.WriteToFile Description:="Startup > Main > mBI_Client=true > LastSyncUser=" & LastSyncUser
'
' makeConnection = True
' If LastSyncUser = GetCurrentUserName Then
' gLogging.WriteToFile Description:="Startup > Main > mBI_Client=true > LastSyncUser = GetCurrentUserName"
'
' If IsTableLocal("Users") And IsTableLocal("UserRoles") Then
' gLogging.WriteToFile Description:="Startup > Main > mBI_Client=true > LastSyncUser = GetCurrentUserName > IsTableLocal"
' makeConnection = False
' End If
' End If
' If makeConnection Then
' MsgBox "Please make sure you are in the companies network or have an open VPN connection!", vbOKOnly
' If IsConnectingPossible("Users") Then
' OrderSheetSyncFunctions.SetupOrderSheet
'
' gLogging.WriteToFile Description:="Startup > Main > mBI_Client=true > makeConnection=true > isConnectingPossible(users)"
' omSSMAAConnector.LinkUsingSSMA Group:="mBIClientUser", ConnectionType:=SQLNCLI, SavePassword:=True
' gLogging.WriteToFile Description:="Startup > Main > mBI_Client=true > makeConnection=true > LinkUsingSSMA for mBIClientUser"
' OrderSheetSyncFunctions.SyncData
' gLogging.WriteToFile Description:="Startup > Main > mBI_Client=true > makeConnection=true > SyncData"
' End If
' Else
' OrderSheetFunctions.LoginCurrentUserName
' End If
' If gCurrentOrderSheetUser.Active Then
' gLogging.WriteToFile Description:="Startup > Main > mBI_Client=true > gCurrentOrderSheetUser.Active"
' omDefaultFunctions.Initialize True
' gLogging.WriteToFile Description:="Startup > Main > mBI_Client=true > gCurrentOrderSheetUser.Active > omDefaultFunctions.Initialize True"
' DoCmd.OpenForm "OrderSheet_List"
' gLogging.WriteToFile Description:="Startup > Main > mBI_Client=true > gCurrentOrderSheetUser.Active > OpenForm OrderSheet_List"
' Else
' omDefaultFunctions.SaveSystemDefault "LastSyncUser", Null
' gLogging.WriteToFile Description:="Startup > Main > mBI_Client=true > SetDefault LastSyncUser=null"
'
' omSSMAAConnector.DeleteLinkTables
' gLogging.WriteToFile Description:="Startup > Main > mBI_Client=true > DeleteLinkTables"
' omSSMAAConnector.DeleteSSMAATables
' gLogging.WriteToFile Description:="Startup > Main > mBI_Client=true > DeleteSSMAATables"
' omSSMAAConnector.DeleteSSMAABackupTables
' gLogging.WriteToFile Description:="Startup > Main > mBI_Client=true > DeleteSSMAABackupTables"
' Application.SetOption "Auto compact", True
' gLogging.WriteToFile Description:="Startup > Main > mBI_Client=true > SetOption Auto Compact=true"
' DoCmd.Quit acQuitSaveNone
' End If
' Else
' omSSMAAConnector.LinkUsingSSMA Group:="mBI", ConnectionType:=SQLNCLI, SavePassword:=True
' DeleteSSMAABackupTables
' omDefaultFunctions.Initialize True
' DoCmd.OpenForm "Flow"
' End If
' 'gDefaults.Mode = ServerMode
' 'gSystemDefaults.Mode = LocalMode
'End Function
'