'------------------------------------------------------------------------
' MODULE: ApplicationInfo
'
' PURPOSE: Application info and security for this application.
'------------------------------------------------------------------------
Option Compare Database
Option Explicit
Const ModuleName = "Application Info"
Private gstrAppShortName As String
Private gstrAppReleaseDate As String
Private gstrAppVersion As String
Function AppName() As String
10 AppName = "Base Code"
End Function
Function AppShortName() As String
' Returns the database name with no extenstion.
Dim strDatabaseName As String
10 If Nz(gstrAppShortName, "") = "" Then
20 strDatabaseName = GetCurrentDBName_TSB()
30 gstrAppShortName = UCase(left$(strDatabaseName, InStr(1, strDatabaseName, ".") - 1))
40 End If
50 AppShortName = gstrAppShortName
End Function
Function AppRegistrationInfo() As String
10 AppRegistrationInfo = "XYZ, Inc."
End Function
Function AppReleaseDate() As String
10 If Nz(gstrAppReleaseDate, "") = "" Then
20 gstrAppReleaseDate = DMax("[ReleaseDate]", "tblAppVersionControl")
30 End If
40 AppReleaseDate = gstrAppReleaseDate
End Function
Function AppSerialNumber() As String
10 AppSerialNumber = "1"
End Function
Function AppVersion() As String
10 If Nz(gstrAppVersion, "") = "" Then
20 gstrAppVersion = DMax("[Version]", "tblAppVersionControl")
30 End If
40 AppVersion = gstrAppVersion
End Function
Function CheckVersion()
Dim pb As New Form_frmProgBar
Dim sngNetVersion As Single
Dim sngLocalVersion As Single
Dim strMsgText As String
Dim strCrLf As String
10 pb.SetMessage "Checking for new version..."
20 pb.SetBarVisible False
30 sngNetVersion = DMax("[Version]", "tblAppVersionControlNet")
40 sngLocalVersion = AppVersion()
50 Set pb = Nothing
60 If sngLocalVersion < sngNetVersion Then
70 strCrLf = Chr$(13) & Chr(10)
80 strMsgText = "You do not have the most recent version of this application. Please update the application." & strCrLf & strCrLf
90 strMsgText = strMsgText & "The following changes have occured:" & strCrLf & strCrLf
100 strMsgText = strMsgText & " " & DLookup("[UserComment]", "tblAppVersionControlNet", "[Version] = " & sngNetVersion)
110 MsgBox strMsgText
120 Call ApplicationExit
130 End If
End Function
|