Skip to content

Commit

Permalink
Merge pull request #1 from AccessCodeLib/dev
Browse files Browse the repository at this point in the history
v1.8.0
  • Loading branch information
josef-poetzl authored May 17, 2023
2 parents e0b35bb + b61d279 commit 9228365
Show file tree
Hide file tree
Showing 21 changed files with 522 additions and 458 deletions.
1 change: 1 addition & 0 deletions .Copy2AddInFolder.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
copy ACLibFilterFormWizard.accdb .\access-add-in\ACLibFilterFormWizard.accda
19 changes: 19 additions & 0 deletions .CreateWorkingFileFormAddInFolder.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@echo off

if exist .\ACLibFilterFormWizard.accdb (
set /p CopyFile=ACLibFilterFormWizard.accdb exists .. overwrite with access-add-in\ACLibFilterFormWizard.accda? [Y/N]:
) else (
set CopyFile=Y
)

if /I %CopyFile% == Y (
echo File is copied ...
) else (
echo Batch is cancelled
pause
exit
)

copy .\access-add-in\ACLibFilterFormWizard.accda ACLibFilterFormWizard.accdb

timeout 2
Binary file modified access-add-in/ACLibFilterFormWizard.accda
Binary file not shown.
27 changes: 7 additions & 20 deletions access-add-in/Install.vbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,24 @@ const AddInName = "ACLib-FilterForm-Wizard"
const AddInFileName = "ACLibFilterFormWizard.accda"
const MsgBoxTitle = "Install ACLib-FilterForm-Wizard"

MsgBox "Vor dem Aktualisieren der Add-In-Datei darf das Add-In nicht geladen sein!" & chr(13) & _
"Zur Sicherheit alle Access-Instanzen schließen.", , MsgBoxTitle & ": Hinweis"
MsgBox "Before updating the add-in file, the add-in must not be loaded!" & chr(13) & _
"Close all access instances for safety.", , MsgBoxTitle & ": Hinweis"

Select Case MsgBox("Soll das Add-In als MDE verwendet werden?" + chr(13) & _
"(Add-In wird kompiliert ins Add-In-Verzeichnis kopiert.)", 3, MsgBoxTitle)
Select Case MsgBox("Should the add-in be used as a compiled file (accde)?" + chr(13) & _
"(Add-In is compiled and copied to the Add-In directory.)", 3, MsgBoxTitle)
case 6 ' vbYes
CreateMde GetSourceFileFullName, GetDestFileFullName
MsgBox "Add-In wurde kompilliert und in '" + GetAddInLocation + "' abgespeichert", , MsgBoxTitle
MsgBox "Add-In was compiled and saved in '" + GetAddInLocation + "'.", , MsgBoxTitle
case 7 ' vbNo
FileCopy GetSourceFileFullName, GetDestFileFullName
MsgBox "Add-In wurde in '" + GetAddInLocation + "' abgespeichert", , MsgBoxTitle
MsgBox "Add-In was saved in '" + GetAddInLocation + "'.", , MsgBoxTitle
case else

End Select





'##################################################
' Hilfsfunktionen:
' Utility functions:

Function GetSourceFileFullName()
GetSourceFileFullName = GetScriptLocation & AddInFileName
Expand All @@ -33,36 +30,26 @@ Function GetDestFileFullName()
End Function

Function GetScriptLocation()

With WScript
GetScriptLocation = Replace(.ScriptFullName & ":", .ScriptName & ":", "")
End With

End Function

Function GetAddInLocation()

GetAddInLocation = GetAppDataLocation & "Microsoft\AddIns\"

End Function

Function GetAppDataLocation()

Set wsShell = CreateObject("WScript.Shell")
GetAppDataLocation = wsShell.ExpandEnvironmentStrings("%APPDATA%") & "\"

End Function

Function FileCopy(SourceFilePath, DestFilePath)

set fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFile SourceFilePath, DestFilePath

End Function

Function CreateMde(SourceFilePath, DestFilePath)

Set AccessApp = CreateObject("Access.Application")
AccessApp.SysCmd 603, (SourceFilePath), (DestFilePath)

End Function
61 changes: 28 additions & 33 deletions source/_config_Application.bas
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
Attribute VB_Name = "_config_Application"
'---------------------------------------------------------------------------------------
' Modul: _initApplication
'---------------------------------------------------------------------------------------
'/**
' <summary>
' Application configuration
' </summary>
' <remarks>
' </remarks>
'**/
'---------------------------------------------------------------------------------------
'<codelib>
' <file>%AppFolder%/source/_config_Application.bas</file>
' <replace>base/_config_Application.bas</replace> 'dieses Modul ersetzt base/_config_Application.bas
' <replace>base/_config_Application.bas</replace>
' <license>_codelib/license.bas</license>
' <use>%AppFolder%/source/defGlobal_ACLibFilterFormWizard.bas</use>
' <use>base/_initApplication.bas</use>
Expand All @@ -15,20 +25,20 @@ Attribute VB_Name = "_config_Application"
'</codelib>
'---------------------------------------------------------------------------------------
'
' Nicht vergessen: USELOCALIZATION = 1 als Compiler-Arg. in Projekteigenschaft einstellen
' Don't forget: set USELOCALIZATION = 1 as Compiler argument in Project properties
'
'
Option Compare Database
Option Explicit
Option Private Module

'Versionsnummer
Private Const APPLICATION_VERSION As String = "1.7.1" '2023-03-01
'Version
Private Const APPLICATION_VERSION As String = "1.8.0" '2023-05

#Const USE_CLASS_APPLICATIONHANDLER_APPFILE = 1
#Const USE_CLASS_APPLICATIONHANDLER_VERSION = 1

Private Const APPLICATION_NAME As String = "ACLib FilterForm Wizard"
Public Const APPLICATION_NAME As String = "ACLib FilterForm Wizard"
Private Const APPLICATION_FULLNAME As String = "Access Code Library - FilterForm Wizard"
Private Const APPLICATION_TITLE As String = APPLICATION_FULLNAME
Private Const APPLICATION_ICONFILE As String = "ACLib.ico"
Expand All @@ -49,9 +59,9 @@ Private m_Extensions As ApplicationHandler_ExtensionCollection
'---------------------------------------------------------------------------------------
'/**
' <summary>
' Konfigurationseinstellungen initialisieren
' Init application configuration
' </summary>
' <param name="oCurrentAppHandler">Möglichkeit einer Referenzübergabe, damit nicht CurrentApplication genutzt werden muss</param>
' <param name="CurrentAppHandlerRef">Possibility of a reference transfer so that CurrentApplication does not have to be used</param>
' <returns></returns>
' <remarks>
' </remarks>
Expand All @@ -62,47 +72,39 @@ Public Sub InitConfig(Optional ByRef CurrentAppHandlerRef As ApplicationHandler
On Error GoTo HandleErr

'----------------------------------------------------------------------------
' Fehlerbehandlung
' Error handler
'

modErrorHandler.DefaultErrorHandlerMode = DefaultErrorHandlerMode


'----------------------------------------------------------------------------
' Globale Variablen einstellen
'
'defGlobal_FilterFormWizard.ACLibIconFileName = m_ApplicationIconFile


'----------------------------------------------------------------------------
' Anwendungsinstanz einstellen
' Application instance
'
If CurrentAppHandlerRef Is Nothing Then
Set CurrentAppHandlerRef = CurrentApplication
End If

With CurrentAppHandlerRef

'Zur Sicherheit AccDb einstellen
Set .AppDb = CodeDb 'muss auf CodeDb zeigen,
'da diese Anwendung als Add-In verwendet wird
'To be on the safe side, set AccDb
Set .AppDb = CodeDb 'must point to CodeDb,
'as this application is used as an add-in

'Anwendungsname
'Application name
.ApplicationName = APPLICATION_NAME
.ApplicationFullName = APPLICATION_FULLNAME
.ApplicationTitle = APPLICATION_TITLE

'Version
.Version = APPLICATION_VERSION

' Formular, das am Ende von CurrentApplication.Start aufgerufen wird
'Form called at the end of CurrentApplication.Start
.ApplicationStartFormName = ApplicationStartFormName


End With

'----------------------------------------------------------------------------
' Erweiterungen:
' Extensions:
'
Set m_Extensions = New ApplicationHandler_ExtensionCollection
With m_Extensions
Expand All @@ -118,13 +120,6 @@ On Error GoTo HandleErr

End With

'----------------------------------------------------------------------------
' Konfiguration nach Erweiterungen
'

'AppIcon
'oCurrentAppHandler.SetAppIcon CodeProject.Path & "\" & m_ApplicationIconFile, True

ExitHere:
Exit Sub

Expand All @@ -143,11 +138,11 @@ End Sub

'############################################################################
'
' Funktionen für die Anwendungswartung
' (werden nur im Anwendungsentwurf benötigt)
' Functions for application maintenance
' (only needed in the application design)
'
'----------------------------------------------------------------------------
' Hilfsfunktion zum Speichern von Dateien in die lokale AppFile-Tabelle
' Auxiliary function for saving files to the local AppFile table
'----------------------------------------------------------------------------
Private Sub SetAppFiles()
Call CurrentApplication.Extensions("AppFile").SaveAppFile("AppIcon", CodeProject.Path & "\" & APPLICATION_ICONFILE)
Expand Down
67 changes: 0 additions & 67 deletions source/_initApplication.bas

This file was deleted.

Loading

0 comments on commit 9228365

Please sign in to comment.