Skip to content

Commit

Permalink
Rename field group to groups in table T_SSMAA_ODBC_Tables since multi…
Browse files Browse the repository at this point in the history
…ple groups can be listed.

Refactor code to handle changed field name.
  • Loading branch information
RaoulJacobs committed Apr 20, 2020
1 parent c4391c5 commit 27d0a07
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 122 deletions.
6 changes: 3 additions & 3 deletions M_omConnectionString.def
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@ Public Sub ParseByQueryName(Name As String)
queryName = Name
Parse CurrentDb.QueryDefs(queryName).Connect
On Error Resume Next
Description = CurrentDb.QueryDefs(queryName).Properties("Description").value
Description = CurrentDb.QueryDefs(queryName).Properties("Description").Value
Group = omStringFunctions.ParseValue(Description, "Group", splitchar:=";", notFoundValue:="")
End If
End Sub

Private Sub Parse(value As String)
Private Sub Parse(Value As String)
Dim arr() As String
Dim S As Variant

arr = Split(value, ";")
arr = Split(Value, ";")
For Each S In arr
'Debug.Print s
If S = "ODBC" Then IsODBC = True
Expand Down
6 changes: 3 additions & 3 deletions M_omDAOFunctions.def
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Option Compare Database
Option Explicit

Public Sub SetQueryDefProperty(queryName As String, propertyName As String, value As String, Optional propertyType As DAO.DataTypeEnum = dbText)
Public Sub SetQueryDefProperty(queryName As String, propertyName As String, Value As String, Optional propertyType As DAO.DataTypeEnum = dbText)
Dim prp As DAO.Property
On Error Resume Next
Set prp = CurrentDb.QueryDefs(queryName).CreateProperty(propertyName, propertyType, value)
Set prp = CurrentDb.QueryDefs(queryName).CreateProperty(propertyName, propertyType, Value)
CurrentDb.QueryDefs(queryName).Properties.Append prp
If Err = 3367 Then
CurrentDb.QueryDefs(queryName).Properties(propertyName).value = value
CurrentDb.QueryDefs(queryName).Properties(propertyName).Value = Value
End If
On Error GoTo 0
End Sub
10 changes: 5 additions & 5 deletions M_omDateFunctions.def
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ End Function
Public Function WorkingDays(ByVal lYearMonth As Long) As Long
Dim dateWork As Date

dateWork = "01/" & Str(lYearMonth Mod 100) & "/" & Str(Int(lYearMonth / 100))
dateWork = "01/" & str(lYearMonth Mod 100) & "/" & str(Int(lYearMonth / 100))
If Month(dateWork) <> (lYearMonth Mod 100) Then
dateWork = Str(lYearMonth Mod 100) & "/01/" & Str(Int(lYearMonth / 100))
dateWork = str(lYearMonth Mod 100) & "/01/" & str(Int(lYearMonth / 100))
End If
While lYearMonth Mod 100 = Month(dateWork)
If Weekday(dateWork, vbMonday) > 0 And Weekday(dateWork, vbMonday) < 6 Then
Expand All @@ -149,7 +149,7 @@ Dim dateWork As Date
If IsDate(dateFrom) Then
dateWork = dateFrom
If Month(dateWork) <> (lYearMonth Mod 100) Then
dateWork = Str(lYearMonth Mod 100) & "/" & Month(dateWork) & "/" & Str(Int(lYearMonth / 100))
dateWork = str(lYearMonth Mod 100) & "/" & Month(dateWork) & "/" & str(Int(lYearMonth / 100))
End If
While lYearMonth Mod 100 = Month(dateWork)
If Weekday(dateWork, vbMonday) > 0 And Weekday(dateWork, vbMonday) < 6 Then
Expand All @@ -168,7 +168,7 @@ Dim dateWork As Date
If IsDate(dateFrom) Then
dateWork = dateFrom
If Month(dateWork) <> (lYearMonth Mod 100) Then
dateWork = Str(lYearMonth Mod 100) & "/" & Month(dateWork) & "/" & Str(Int(lYearMonth / 100))
dateWork = str(lYearMonth Mod 100) & "/" & Month(dateWork) & "/" & str(Int(lYearMonth / 100))
End If
While lYearMonth Mod 100 = Month(dateWork)
If Weekday(dateWork, vbMonday) > 0 And Weekday(dateWork, vbMonday) < 6 Then
Expand Down Expand Up @@ -403,7 +403,7 @@ Dim maxDate As Date

minDate = Nz(DMax("Date", "Calendar"), DateSerial(2017, 1, 1) - 1) + 1
maxDate = DateSerial(Year(Now) + 2, 1, 1) - 1
rs.Open "Calendar", CurrentProject.Connection, adOpenForwardOnly, adLockOptimistic
rs.Open "Calendar", CurrentProject.connection, adOpenForwardOnly, adLockOptimistic
While minDate <= maxDate
rs.AddNew
rs("Date") = minDate
Expand Down
4 changes: 2 additions & 2 deletions M_omDefaults.def
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ Dim tableName As String
Initialized = False
If omMSAccessFunctions.TableExists(tableName) Then
cmdGetValue.commandText = "SELECT [Value],[ModifyDate] FROM " & tableName & " WHERE [Name]=?"
cmdGetValue.ActiveConnection = CurrentProject.Connection
cmdGetValue.ActiveConnection = CurrentProject.connection
cmdGetValue.Parameters.Refresh ' Does Not Work if there is a mistake in the SQL statement EG not existing Table
'cmdGetValue.Parameters.Append cmdGetValue.CreateParameter("Name", adVarWChar, adParamInput, 256)

cmdSetValue.commandText = "UPDATE [" & IIf(gMode = LocalMode, "omSysDefaults", "omDefaults") & "] SET [Value]=?,[ModifyDate]=? WHERE [Name]=?"
cmdSetValue.ActiveConnection = CurrentProject.Connection
cmdSetValue.ActiveConnection = CurrentProject.connection
cmdSetValue.Parameters.Refresh
'cmdSetValue.Parameters.Append cmdGetValue.CreateParameter("Value", adVarChar, adParamInput, 256)
'cmdSetValue.Parameters.Append cmdGetValue.CreateParameter("ModifyDate", adDate, adParamInput)
Expand Down
4 changes: 2 additions & 2 deletions M_omFileFunctions.def
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ Dim F As Scripting.File
DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE * FROM [" & tableName & "]"
DoCmd.SetWarnings True
rs.Open tableName, CurrentProject.Connection, adOpenForwardOnly, adLockOptimistic
rs.Open tableName, CurrentProject.connection, adOpenForwardOnly, adLockOptimistic
For Each F In gFso.GetFolder(folderPath).Files
If InStr(1, F.Name, pattern) <> 0 And InStr(1, F.Name, "~") = 0 Then
rs.AddNew
Expand All @@ -184,7 +184,7 @@ Public Function FileLocked(strFileName As String, Optional displayError As Boole
If Err.Number <> 0 Then
' Display the error number and description.
If displayError Then
MsgBox "Error #" & Str(Err.Number) & " - " & Err.Description
MsgBox "Error #" & str(Err.Number) & " - " & Err.Description
End If
FileLocked = True
Err.Clear
Expand Down
22 changes: 11 additions & 11 deletions M_omMSAccessFunctions.def
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ Public Sub DeleteQuery(queryName As String)
CurrentDb.QueryDefs.Delete queryName
End If
End Sub
Public Sub CreatePassthroughQuery(queryName As String, sql As String, Connection As String)
Public Sub CreatePassthroughQuery(queryName As String, sql As String, connection As String)
Dim qd As QueryDef

DeleteQuery queryName
Set qd = CurrentDb.CreateQueryDef(queryName)
qd.Connect = Connection
qd.Connect = connection
qd.sql = sql
CurrentDb.QueryDefs.Refresh
End Sub
Expand Down Expand Up @@ -70,7 +70,7 @@ End Sub
Public Sub ConvertToLocalTables(Optional databaseType As String = ".accdb")
Dim rs As New ADODB.Recordset

rs.Open "SELECT Name,Database,lv FROM MsysObjects WHERE [Type]=6 AND LV IS NOT NULL", CurrentProject.Connection, adOpenForwardOnly, adLockReadOnly
rs.Open "SELECT Name,Database,lv FROM MsysObjects WHERE [Type]=6 AND LV IS NOT NULL", CurrentProject.connection, adOpenForwardOnly, adLockReadOnly
While Not rs.EOF
If (omStringFunctions.IsNullOrEmpty(databaseType) Or InStr(1, rs("Database"), databaseType) > 0) And InStr(1, rs("Name"), "~") = 0 Then
'On Error Resume Next
Expand Down Expand Up @@ -119,7 +119,7 @@ Dim idx As DAO.index
omMSAccessFunctions.DeleteTable tempTableName
gLogging.WriteToFile Description:="MakeLinkedTable > DeleteTable tempTableName"

CurrentProject.Connection.Execute "SELECT * INTO [" & tempTableName & "] FROM [" & tableName & "]"
CurrentProject.connection.Execute "SELECT * INTO [" & tempTableName & "] FROM [" & tableName & "]"
gLogging.WriteToFile Description:="MakeLinkedTable > SELECT INTO FROM"
' copy existing indexes
Workspaces(0).Databases(0).TableDefs.Refresh
Expand Down Expand Up @@ -169,7 +169,7 @@ End Sub

Public Sub DropIndexUsingSQL(tableName As String, indexName As String)
On Error Resume Next
CurrentProject.Connection.Execute StringFormat("DROP INDEX [{0}] ON [{1}]", indexName, tableName)
CurrentProject.connection.Execute StringFormat("DROP INDEX [{0}] ON [{1}]", indexName, tableName)
End Sub

Public Sub CreateIndexUsingSQL(tableName As String, indexName As String, fieldNames As String, Optional setPrimary As Boolean = False, Optional setUnique As Boolean = False, Optional setDisallowNull As Boolean = False)
Expand All @@ -183,7 +183,7 @@ Dim sql As String
End If
DropIndexUsingSQL tableName, indexName
gLogging.WriteToFile Description:="CreateIndexUsingSQL > DropIndexUsingSQL tableName, indexName"
CurrentProject.Connection.Execute sql
CurrentProject.connection.Execute sql
gLogging.WriteToFile Description:="CreateIndexUsingSQL > CurrentProject.Connection.Execute sql"
End Sub

Expand Down Expand Up @@ -228,8 +228,8 @@ Dim ctl As Control

On Error GoTo FormFields_Extract_Error

rsMSysObject.Open "SELECT Name, Type FROM msysobjects WHERE (((Type)=-32768 Or (Type)=-32764))", CurrentProject.Connection, adOpenDynamic, adLockOptimistic
rsFields.Open "Fields", CurrentProject.Connection, adOpenDynamic, adLockOptimistic
rsMSysObject.Open "SELECT Name, Type FROM msysobjects WHERE (((Type)=-32768 Or (Type)=-32764))", CurrentProject.connection, adOpenDynamic, adLockOptimistic
rsFields.Open "Fields", CurrentProject.connection, adOpenDynamic, adLockOptimistic
While Not rsMSysObject.EOF
Select Case rsMSysObject("Type")
Case -32768 ' Form
Expand Down Expand Up @@ -284,13 +284,13 @@ Dim ctl As Object

On Error GoTo cmdBarFields_Extract_Error

rsFields.Open "Fields", CurrentProject.Connection, adOpenDynamic, adLockOptimistic
rsFields.Open "Fields", CurrentProject.connection, adOpenDynamic, adLockOptimistic
If strcmdBar <> "" Then
For Each ctl In CommandBars(strcmdBar).Controls
With ctl
rsFields.AddNew
rsFields("Field_ID") = newField_ID
rsFields("Field_Name") = .tag
rsFields("Field_Name") = .Tag
rsFields.Update
If .Type = 10 Then
cmdBarFields_Extract "", ctl
Expand All @@ -302,7 +302,7 @@ Dim ctl As Object
With ctl
rsFields.AddNew
rsFields("Field_ID") = newField_ID
rsFields("Field_Name") = .tag
rsFields("Field_Name") = .Tag
rsFields.Update
If .Type = 10 Then
cmdBarFields_Extract "", ctl
Expand Down
50 changes: 25 additions & 25 deletions M_omSSMAAConnector.def
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ Dim strDatabaseName As String

UpdateSSMAConnectionString Group, ConnectionType
rs.Open "SELECT Name, Type FROM MSysObjects WHERE Type=1 OR Type=6 OR Type=4", LocalCon, adOpenStatic, adLockReadOnly
'rsODBC.Open "SELECT * FROM SSMAA_ODBC_Tables" & IIf(Group <> "", " WHERE [Groups] like " & Chr(34) & "%," & Group & ",%" & Chr(34), ""), LocalCon, adOpenForwardOnly, adLockOptimistic
rsODBC.Open "SELECT * FROM SSMAA_ODBC_Tables" & IIf(Group <> "", " WHERE [Group] like " & Chr(34) & "%," & Group & ",%" & Chr(34), ""), LocalCon, adOpenForwardOnly, adLockOptimistic
rsODBC.Open "SELECT * FROM SSMAA_ODBC_Tables" & IIf(Group <> "", " WHERE [Groups] like " & Chr(34) & "%," & Group & ",%" & Chr(34), ""), LocalCon, adOpenForwardOnly, adLockOptimistic
'rsODBC.Open "SELECT * FROM SSMAA_ODBC_Tables" & IIf(Group <> "", " WHERE [Group] like " & Chr(34) & "%," & Group & ",%" & Chr(34), ""), LocalCon, adOpenForwardOnly, adLockOptimistic
While Not rsODBC.EOF
'rs.Requery
rs.Filter = "Name='" & rsODBC("ODBCTable") & "'"
Expand Down Expand Up @@ -117,8 +117,8 @@ Dim rs As New ADODB.Recordset
Dim cmd As New ADODB.Command

Set omCSLastUsed = New omConnectionString
'cmd.CommandText = "UPDATE SSMAA_ODBC_Tables SET ConnectionString=? WHERE nz([Groups],'')=? AND nz(DSN,'')=? AND nz(SQLServer,'')=? AND nz(SQLServerPort,'')=? AND nz(SQLDatabase,'')=? AND nz(ConnectionTypeId,'')=? AND nz(SQLLogin,'')=? AND nz(SQLPassword,'')=?"
cmd.commandText = "UPDATE SSMAA_ODBC_Tables SET ConnectionString=? WHERE nz([Group],'')=? AND nz(DSN,'')=? AND nz(SQLServer,'')=? AND nz(SQLServerPort,'')=? AND nz(SQLDatabase,'')=? AND nz(ConnectionTypeId,'')=? AND nz(SQLLogin,'')=? AND nz(SQLPassword,'')=?"
cmd.commandText = "UPDATE SSMAA_ODBC_Tables SET ConnectionString=? WHERE nz([Groups],'')=? AND nz(DSN,'')=? AND nz(SQLServer,'')=? AND nz(SQLServerPort,'')=? AND nz(SQLDatabase,'')=? AND nz(ConnectionTypeId,'')=? AND nz(SQLLogin,'')=? AND nz(SQLPassword,'')=?"
'cmd.commandText = "UPDATE SSMAA_ODBC_Tables SET ConnectionString=? WHERE nz([Group],'')=? AND nz(DSN,'')=? AND nz(SQLServer,'')=? AND nz(SQLServerPort,'')=? AND nz(SQLDatabase,'')=? AND nz(ConnectionTypeId,'')=? AND nz(SQLLogin,'')=? AND nz(SQLPassword,'')=?"
cmd.ActiveConnection = LocalCon
cmd.Parameters.Append cmd.CreateParameter("p1", adVarWChar, adParamInput, 512)
cmd.Parameters.Append cmd.CreateParameter("p2", adLongVarWChar, adParamInput, 256)
Expand All @@ -130,13 +130,13 @@ Dim cmd As New ADODB.Command
cmd.Parameters.Append cmd.CreateParameter("p8", adLongVarWChar, adParamInput, 256)
cmd.Parameters.Append cmd.CreateParameter("p9", adLongVarWChar, adParamInput, 256)

'rs.Open "SELECT [Groups], DSN, SQLServer, SQLServerPort, SQLDatabase, ConnectionTypeId, SQLLogin, SQLPassword From SSMAA_ODBC_Tables " & IIf(Group <> "", " WHERE [Groups] like " & Chr(34) & "%," & Group & ",%" & Chr(34), "") & " GROUP BY [Groups], DSN, SQLServer, SQLServerPort, SQLDatabase, ConnectionTypeId, SQLLogin, SQLPassword", LocalCon, adOpenForwardOnly, adLockReadOnly
rs.Open "SELECT [Group], DSN, SQLServer, SQLServerPort, SQLDatabase, ConnectionTypeId, SQLLogin, SQLPassword From SSMAA_ODBC_Tables " & IIf(Group <> "", " WHERE [Group] like " & Chr(34) & "%," & Group & ",%" & Chr(34), "") & " GROUP BY [Group], DSN, SQLServer, SQLServerPort, SQLDatabase, ConnectionTypeId, SQLLogin, SQLPassword", LocalCon, adOpenForwardOnly, adLockReadOnly
rs.Open "SELECT [Groups], DSN, SQLServer, SQLServerPort, SQLDatabase, ConnectionTypeId, SQLLogin, SQLPassword From SSMAA_ODBC_Tables " & IIf(Group <> "", " WHERE [Groups] like " & Chr(34) & "%," & Group & ",%" & Chr(34), "") & " GROUP BY [Groups], DSN, SQLServer, SQLServerPort, SQLDatabase, ConnectionTypeId, SQLLogin, SQLPassword", LocalCon, adOpenForwardOnly, adLockReadOnly
'rs.Open "SELECT [Group], DSN, SQLServer, SQLServerPort, SQLDatabase, ConnectionTypeId, SQLLogin, SQLPassword From SSMAA_ODBC_Tables " & IIf(Group <> "", " WHERE [Group] like " & Chr(34) & "%," & Group & ",%" & Chr(34), "") & " GROUP BY [Group], DSN, SQLServer, SQLServerPort, SQLDatabase, ConnectionTypeId, SQLLogin, SQLPassword", LocalCon, adOpenForwardOnly, adLockReadOnly
While Not rs.EOF
'cmd.Parameters(0) = omCSLastUsed.GetConnectionString(Nz(rs("sqlDatabase"), ""), Nz(rs("SQLServer"), ""), False, Nz(rs("ConnectionTypeId"), ConnectionType), Nz(rs("DSN"), ""), Nz(rs("SQLLogin"), ""), Nz(rs("SQLPassword"), ""), Nz(rs("Groups"), ""), Nz(rs("SQLServerPort"), ""))
cmd.Parameters(0) = omCSLastUsed.GetConnectionString(Nz(rs("sqlDatabase"), ""), Nz(rs("SQLServer"), ""), False, Nz(rs("ConnectionTypeId"), ConnectionType), Nz(rs("DSN"), ""), Nz(rs("SQLLogin"), ""), Nz(rs("SQLPassword"), ""), Nz(rs("Group"), ""), Nz(rs("SQLServerPort"), ""))
'cmd.Parameters(1) = Nz(rs("Groups"), "")
cmd.Parameters(1) = Nz(rs("Group"), "")
cmd.Parameters(0) = omCSLastUsed.GetConnectionString(Nz(rs("sqlDatabase"), ""), Nz(rs("SQLServer"), ""), False, Nz(rs("ConnectionTypeId"), ConnectionType), Nz(rs("DSN"), ""), Nz(rs("SQLLogin"), ""), Nz(rs("SQLPassword"), ""), Nz(rs("Groups"), ""), Nz(rs("SQLServerPort"), ""))
'cmd.Parameters(0) = omCSLastUsed.GetConnectionString(Nz(rs("sqlDatabase"), ""), Nz(rs("SQLServer"), ""), False, Nz(rs("ConnectionTypeId"), ConnectionType), Nz(rs("DSN"), ""), Nz(rs("SQLLogin"), ""), Nz(rs("SQLPassword"), ""), Nz(rs("Group"), ""), Nz(rs("SQLServerPort"), ""))
cmd.Parameters(1) = Nz(rs("Groups"), "")
'cmd.Parameters(1) = Nz(rs("Group"), "")
cmd.Parameters(2) = Nz(rs("DSN"), "")
cmd.Parameters(3) = Nz(rs("SQLServer"), "")
cmd.Parameters(4) = Nz(rs("SQLServerPort"), "")
Expand Down Expand Up @@ -219,8 +219,8 @@ Dim strFilter As String
strFilter = strFilter & IIf(NotIsNullOrEmpty(databaseName), " AND sqldatabase='{1}'", "")
strFilter = strFilter & IIf(NotIsNullOrEmpty(serverName), " AND sqlserver='{2}'", "")
strFilter = strFilter & IIf(NotIsNullOrEmpty(dsnName), " AND dsn='{3}'", "")
strFilter = strFilter & IIf(NotIsNullOrEmpty(groupName), " AND group like '%,{4},%'", "")
'strFilter = strFilter & IIf(NotIsNullOrEmpty(groupName), " AND groups like '%,{4},%'", "")
'strFilter = strFilter & IIf(NotIsNullOrEmpty(groupName), " AND group like '%,{4},%'", "")
strFilter = strFilter & IIf(NotIsNullOrEmpty(groupName), " AND groups like '%,{4},%'", "")
If NotIsNullOrEmpty(strFilter) Then
rs.Filter = StringFormat(Mid(strFilter, 6), tableName, databaseName, serverName, dsnName, groupName)
If rs.EOF Then
Expand Down Expand Up @@ -254,8 +254,8 @@ Dim strFilter As String
If NotIsNullOrEmpty(strFilter) Then
rs.Filter = StringFormat(Mid(strFilter, 6), tableName, databaseName, serverName, dsnName)
If Not rs.EOF Then
GetGroupByProperty = rs("Group")
'GetGroupByProperty = rs("Groups")
'GetGroupByProperty = rs("Group")
GetGroupByProperty = rs("Groups")
If NotIsNullOrEmpty(GetGroupByProperty) Then
If Left(GetGroupByProperty, 1) = "," Then
GetGroupByProperty = Mid(GetGroupByProperty, 2)
Expand Down Expand Up @@ -302,8 +302,8 @@ Dim t As String
rsTable("SQLDatabase") = omCSTest.Database
rsTable("SQLLogin") = omCSTest.UID
rsTable("SQLPassword") = omCSTest.PWD
rsTable("Group") = omCSTest.DSN
'rsTable("Groups") = omCSTest.DSN
'rsTable("Group") = omCSTest.DSN
rsTable("Groups") = omCSTest.DSN
t = CurrentDb.TableDefs(rs("Name")).SourceTableName
If InStr(1, t, ".") = 0 Then
rsTable("SQLTableOwner") = ""
Expand Down Expand Up @@ -535,14 +535,14 @@ Public Sub LinkMSAccess(Optional linkLocal As Boolean = False)
Dim tblCon As New omTableConnector
Dim DefaultPath As String
Dim dataPath As String
Dim FileName As String
Dim filename As String


FileName = omFileFunctions.RemoveExtension(CurrentProject.Name)
If InStrRev(FileName, "_client") > 0 Then
FileName = Replace(FileName, "_client", "")
filename = omFileFunctions.RemoveExtension(CurrentProject.Name)
If InStrRev(filename, "_client") > 0 Then
filename = Replace(filename, "_client", "")
End If
FileName = FileName & "_Data"
filename = filename & "_Data"
gSystemDefaults.Mode = LocalMode
gSystemDefaults.Development = gDevelopmentMode
If linkLocal Then
Expand All @@ -551,15 +551,15 @@ Dim FileName As String
dataPath = Nz(gSystemDefaults.Load("DataPath"), "")
End If

DefaultPath = omFileFunctions.BuildPathFileExists(dataPath, FileName & ".mdb")
DefaultPath = omFileFunctions.BuildPathFileExists(dataPath, filename & ".mdb")
If DefaultPath = "" Then
DefaultPath = omFileFunctions.BuildPathFileExists(dataPath, FileName & ".accdb")
DefaultPath = omFileFunctions.BuildPathFileExists(dataPath, filename & ".accdb")
End If
If DefaultPath = "" Then
DefaultPath = omFileFunctions.BuildPathFileExists(CurrentProject.path, FileName & ".mdb")
DefaultPath = omFileFunctions.BuildPathFileExists(CurrentProject.path, filename & ".mdb")
End If
If DefaultPath = "" Then
DefaultPath = omFileFunctions.BuildPathFileExists(CurrentProject.path, FileName & ".accdb")
DefaultPath = omFileFunctions.BuildPathFileExists(CurrentProject.path, filename & ".accdb")
End If
If Not gFso.FileExists(DefaultPath) Then
MsgBox "No Data file was found at the location: " & DefaultPath & vbCrLf & "Application will now be closed.", vbCritical
Expand Down
Loading

0 comments on commit 27d0a07

Please sign in to comment.