Skip to content

Commit bc37507

Browse files
authored
MsAccessVCS integration (#54)
* New TestResultReporter for MsAccessVCS
1 parent ee4f0dd commit bc37507

13 files changed

+296
-168
lines changed

access-add-in/AccUnitLoader.accda

-40 KB
Binary file not shown.

access-add-in/source/forms/AccUnitLoaderForm.bas

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Begin Form
2626
0x212b6fd80e9ce340
2727
End
2828
Caption ="ACLib - AccUnit Loader"
29+
OnOpen ="[Event Procedure]"
2930
DatasheetFontName ="Calibri"
3031
OnTimer ="[Event Procedure]"
3132
OnLoad ="[Event Procedure]"

access-add-in/source/forms/AccUnitLoaderForm.cls

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -221,14 +221,7 @@ End Sub
221221

222222
Private Sub Form_Load()
223223

224-
Dim ReferenceFixed As Boolean
225-
Dim ReferenceFixedMessage As String
226-
227224
On Error GoTo ErrMissingPath
228-
CheckAccUnitTypeLibFile CodeVBProject, ReferenceFixed, ReferenceFixedMessage
229-
If Len(ReferenceFixedMessage) Then
230-
Me.labInfo.Caption = ReferenceFixedMessage
231-
End If
232225

233226
With CurrentApplication
234227
Me.Caption = .ApplicationTitle & " " & VBA.ChrW(&H25AA) & " Version " & .Version
@@ -250,6 +243,18 @@ ErrMissingPath:
250243

251244
End Sub
252245

246+
Private Sub Form_Open(Cancel As Integer)
247+
248+
Dim ReferenceFixed As Boolean
249+
Dim ReferenceFixedMessage As String
250+
251+
modTypeLibCheck.CheckAccUnitTypeLibFile modVbProject.CodeVBProject, ReferenceFixed, ReferenceFixedMessage
252+
If VBA.Len(ReferenceFixedMessage) Then
253+
Me.labInfo.Caption = ReferenceFixedMessage
254+
End If
255+
256+
End Sub
257+
253258
Private Sub Form_Timer()
254259
Me.TimerInterval = 0
255260
Me.labInfo.Caption = vbNullString

access-add-in/source/modules/ACLibConfiguration.cls

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,11 @@ Public Property Get LocalRepositoryPath() As String
148148
If Len(m_LocalRepositoryPath) = 0 Then
149149
m_LocalRepositoryPath = GetACLibGlobalProperty(PROPNAME_LOCALREPOSITORYROOT)
150150
If Len(m_LocalRepositoryPath) > 0 Then
151-
If Not DirExists(m_LocalRepositoryPath) Then
151+
If Not FileTools.DirExists(m_LocalRepositoryPath) Then
152152
Err.Raise vbObjectError, "ACLibConfiguration.LocalRepositoryPath", "Das Verzeichnis '" & m_LocalRepositoryPath & "' ist nicht vorhanden!"
153153
m_LocalRepositoryPath = vbNullString
154154
End If
155-
If Right$(m_LocalRepositoryPath, 1) <> "\" Then
155+
If VBA.Right$(m_LocalRepositoryPath, 1) <> "\" Then
156156
m_LocalRepositoryPath = m_LocalRepositoryPath & "\"
157157
SetACLibGlobalProperty PROPNAME_LOCALREPOSITORYROOT, m_LocalRepositoryPath
158158
End If
@@ -165,8 +165,8 @@ End Property
165165

166166
Public Property Let LocalRepositoryPath(ByVal NewPath As String)
167167

168-
If Len(NewPath) > 0 Then
169-
If Right$(NewPath, 1) <> "\" Then
168+
If VBA.Len(NewPath) > 0 Then
169+
If VBA.Right$(NewPath, 1) <> "\" Then
170170
NewPath = NewPath & "\"
171171
End If
172172
End If
@@ -181,11 +181,11 @@ Public Property Get PrivateRepositoryPath() As String
181181
If Len(m_PrivateRepositoryPath) = 0 Then
182182
m_PrivateRepositoryPath = GetACLibGlobalProperty(PROPNAME_PRIVATEREPOSITORYROOT)
183183
If Len(m_PrivateRepositoryPath) > 0 Then
184-
If Not DirExists(m_PrivateRepositoryPath) Then
184+
If Not FileTools.DirExists(m_PrivateRepositoryPath) Then
185185
Err.Raise vbObjectError, "ACLibConfiguration.PrivateRepositoryPath", "Das Verzeichnis '" & m_PrivateRepositoryPath & "' ist nicht vorhanden!"
186186
m_PrivateRepositoryPath = vbNullString
187187
End If
188-
If Right$(m_PrivateRepositoryPath, 1) <> "\" Then
188+
If VBA.Right$(m_PrivateRepositoryPath, 1) <> "\" Then
189189
m_PrivateRepositoryPath = m_PrivateRepositoryPath & "\"
190190
SetACLibGlobalProperty PROPNAME_PRIVATEREPOSITORYROOT, m_PrivateRepositoryPath
191191
End If
@@ -198,8 +198,8 @@ End Property
198198

199199
Public Property Let PrivateRepositoryPath(ByVal NewPath As String)
200200

201-
If Len(NewPath) > 0 Then
202-
If Right$(NewPath, 1) <> "\" Then
201+
If VBA.Len(NewPath) > 0 Then
202+
If VBA.Right$(NewPath, 1) <> "\" Then
203203
NewPath = NewPath & "\"
204204
End If
205205
End If
@@ -214,23 +214,23 @@ Public Property Get ImportTestsDefaultValue() As Boolean
214214
' 2 = true
215215

216216
If m_ImportTestDefaultValue = 0 Then
217-
m_ImportTestDefaultValue = Val(GetACLibGlobalProperty(PROPNAME_IMPORTTESTDEFAULTVALUE)) + 1
217+
m_ImportTestDefaultValue = VBA.Val(GetACLibGlobalProperty(PROPNAME_IMPORTTESTDEFAULTVALUE)) + 1
218218
End If
219219
ImportTestsDefaultValue = (m_ImportTestDefaultValue = 2)
220220

221221
End Property
222222

223223
Public Property Let ImportTestsDefaultValue(ByVal NewValue As Boolean)
224224

225-
m_ImportTestDefaultValue = Abs(NewValue) + 1
226-
SetACLibGlobalProperty PROPNAME_IMPORTTESTDEFAULTVALUE, Abs(NewValue)
225+
m_ImportTestDefaultValue = VBA.Abs(NewValue) + 1
226+
SetACLibGlobalProperty PROPNAME_IMPORTTESTDEFAULTVALUE, VBA.Abs(NewValue)
227227

228228
End Property
229229

230230
Public Property Get GitHubAuthPersonalAccessToken() As String
231231
'm_GitHubAuthPersonalAccessToken: vbnullstring = noch nicht abgefragt
232232

233-
If StrPtr(m_GitHubAuthPersonalAccessToken) = 0 Then
233+
If VBA.StrPtr(m_GitHubAuthPersonalAccessToken) = 0 Then
234234
m_GitHubAuthPersonalAccessToken = GetACLibGlobalProperty(PROPNAME_GITHUBAUTHPERSONALACCESSTOKEN) & ""
235235
End If
236236
GitHubAuthPersonalAccessToken = m_GitHubAuthPersonalAccessToken
@@ -249,7 +249,7 @@ Friend Function GetACLibGlobalProperty(ByRef PropertyName As String) As String
249249
Dim rst As DAO.Recordset
250250
Dim SelectSql As String
251251

252-
SelectSql = Replace(SQL_SELECT_PROPERTYVALUE, "[?]", DaoSqlTool.TextToSqlText(PropertyName))
252+
SelectSql = VBA.Replace(SQL_SELECT_PROPERTYVALUE, "[?]", DaoSqlTool.TextToSqlText(PropertyName))
253253
Set rst = ACLibPropertyDb.OpenRecordset(SelectSql)
254254
If Not rst.EOF Then
255255
GetACLibGlobalProperty = Nz(rst.Fields(SQL_CONFIG_TABLE_FIELD_PROPVALUE), vbNullString)
@@ -265,7 +265,7 @@ Friend Function SetACLibGlobalProperty(ByRef PropertyName As String, ByRef NewVa
265265
Dim rst As DAO.Recordset
266266
Dim SelectSql As String
267267

268-
SelectSql = Replace(SQL_SELECT_PROPERTYVALUE, "[?]", DaoSqlTool.TextToSqlText(PropertyName))
268+
SelectSql = VBA.Replace(SQL_SELECT_PROPERTYVALUE, "[?]", DaoSqlTool.TextToSqlText(PropertyName))
269269
Set rst = ACLibPropertyDb.OpenRecordset(SelectSql)
270270
If rst.EOF Then
271271
rst.AddNew
@@ -310,7 +310,7 @@ Private Function CheckConfigTableDef() As Boolean
310310

311311
Set db = CodeDb
312312

313-
If Not TableDefExists(ACLIB_CONFIG_TABLEDEFNAME, db) Then
313+
If Not DaoTools.TableDefExists(ACLIB_CONFIG_TABLEDEFNAME, db) Then
314314

315315
Set tdf = db.CreateTableDef(ACLIB_CONFIG_TABLEDEFNAME)
316316
tdf.Connect = ";Database=" & ACLibConfigDatabaseFile
@@ -319,7 +319,7 @@ Private Function CheckConfigTableDef() As Boolean
319319

320320
Else
321321

322-
ConfigDataPath = Mid$(db.TableDefs(ACLIB_CONFIG_TABLEDEFNAME).Connect, Len(";Database=") + 1)
322+
ConfigDataPath = VBA.Mid$(db.TableDefs(ACLIB_CONFIG_TABLEDEFNAME).Connect, Len(";Database=") + 1)
323323
If ConfigDataPath <> ACLibConfigDatabaseFile Then
324324
With db.TableDefs(ACLIB_CONFIG_TABLEDEFNAME)
325325
.Connect = ";Database=" & ACLibConfigDatabaseFile
@@ -339,9 +339,9 @@ Public Property Get ACLibConfigDirectory() As String
339339

340340
Dim strPath As String
341341

342-
strPath = Environ("Appdata") & "\" & ACLIB_CONFIG_ROOTFOLDERNAME & "\"
343-
If Len(Dir$(strPath, vbDirectory)) = 0 Then
344-
MkDir strPath
342+
strPath = VBA.Environ("Appdata") & "\" & ACLIB_CONFIG_ROOTFOLDERNAME & "\"
343+
If VBA.Len(VBA.Dir$(strPath, vbDirectory)) = 0 Then
344+
VBA.MkDir strPath
345345
End If
346346

347347
ACLibConfigDirectory = strPath
@@ -352,7 +352,7 @@ Private Property Get ACLibConfigDirectoryDepr() As String
352352

353353
Dim strPath As String
354354

355-
strPath = Environ("Appdata") & "\" & ACLIB_CONFIG_ROOTFOLDERNAME_DEPR & "\"
355+
strPath = VBA.Environ("Appdata") & "\" & ACLIB_CONFIG_ROOTFOLDERNAME_DEPR & "\"
356356

357357
ACLibConfigDirectoryDepr = strPath
358358

@@ -373,26 +373,26 @@ Private Property Get ACLibConfigDatabaseFile() As String
373373
#End If
374374

375375
strDbFileExt = CodeDb.Name
376-
strDbFileExt = Mid$(strDbFileExt, InStrRev(strDbFileExt, "."))
377-
If Left$(strDbFileExt, 5) = ".accd" Then
376+
strDbFileExt = VBA.Mid$(strDbFileExt, VBA.InStrRev(strDbFileExt, "."))
377+
If VBA.Left$(strDbFileExt, 5) = ".accd" Then
378378
strDbFileExt = ".accdu"
379379
Else
380380
strDbFileExt = ".mdt"
381381
End If
382382
strDbFile = ACLibConfigDirectory & ACLIB_CONFIG_DATABASENAME & strDbFileExt
383383

384384
' Try transfer file from deprecated folder path:
385-
If Len(Dir$(strDbFile)) = 0 Then
385+
If VBA.Len(VBA.Dir$(strDbFile)) = 0 Then
386386
strDbFileDepr = ACLibConfigDirectoryDepr & ACLIB_CONFIG_DATABASENAME & strDbFileExt
387-
If Len(Dir$(strDbFileDepr)) > 0 Then
388-
FileCopy strDbFileDepr, strDbFile
387+
If VBA.Len(VBA.Dir$(strDbFileDepr)) > 0 Then
388+
VBA.FileCopy strDbFileDepr, strDbFile
389389
End If
390390
End If
391391

392-
If Len(Dir$(strDbFile)) = 0 Then
392+
If VBA.Len(VBA.Dir$(strDbFile)) = 0 Then
393393

394394
'Datenbank anlegen
395-
If CodeDb.Version = "4.0" Then
395+
If Application.CodeDb.Version = "4.0" Then
396396
Set db = DBEngine.CreateDatabase(strDbFile, dbLangGeneral, dbVersion40)
397397
Else
398398
Set db = DBEngine.CreateDatabase(strDbFile, dbLangGeneral)

access-add-in/source/modules/AccUnitConfiguration.cls

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ Option Explicit
2020

2121
Private m_DaoSqlTools As SqlTools
2222

23-
Private Const EXTENSION_KEY As String = "AccUnitConfiguration"
24-
2523
#Const ADODB_EARLYBINDING = 0
2624
'ADODB wird hier über Late binding eingesetzt, da es nur zum Erstellen der Tabelle genutzt wird
2725

@@ -36,80 +34,13 @@ Private m_PrivateRepositoryPath As String ' privates Verzeichnis (nicht in CodeL
3634
Private m_ImportTestDefaultValue As Long
3735
Private m_ACLibPropertyDb As DAO.Database
3836

39-
'---------------------------------------------------------------------------------------
40-
' Standard-Initialisierung von Erweiterungen
41-
'---------------------------------------------------------------------------------------
42-
43-
Private WithEvents m_ApplicationHandler As ApplicationHandler
44-
Attribute m_ApplicationHandler.VB_VarHelpID = -1
45-
46-
Public Property Set ApplicationHandlerRef(ByRef ObjRef As ApplicationHandler)
47-
Set m_ApplicationHandler = ObjRef
48-
End Property
49-
50-
Public Property Get ExtensionKey() As String
51-
ExtensionKey = EXTENSION_KEY
52-
End Property
53-
54-
'---------------------------------------------------------------------------------------
55-
' Standard-Ereignisbehandlung von Erweiterungen
56-
'---------------------------------------------------------------------------------------
57-
58-
' CheckExtension
59-
Private Sub m_ApplicationHandler_CheckExtension(ByVal ExtensionKeyToCheck As String, ByRef Exists As Boolean)
60-
If ExtensionKeyToCheck = EXTENSION_KEY Then Exists = True
61-
End Sub
62-
63-
' ExtensionLookup
64-
Private Sub m_ApplicationHandler_ExtensionLookup(ByVal ExtensionKeyToCheck As String, ByRef ExtensionReference As Object)
65-
If ExtensionKeyToCheck = EXTENSION_KEY Then
66-
Set ExtensionReference = Me
67-
End If
68-
End Sub
69-
70-
'ExtensionPropertyLookup
71-
Private Sub m_ApplicationHandler_ExtensionPropertyLookup( _
72-
ByVal ExtensionKeyToCheck As String, ByVal PropertyName As String, _
73-
ByRef ResumeMode As ApplicationHandlerResumeModes, ByRef ResumeMessage As Variant)
74-
If ExtensionKeyToCheck = EXTENSION_KEY Then
75-
GetExtensionPropertyLookup PropertyName, ResumeMode, ResumeMessage
76-
End If
77-
End Sub
78-
79-
' AfterDispose
80-
Private Sub m_ApplicationHandler_AfterDispose(ByRef ResumeMode As ApplicationHandlerResumeModes, ByRef ResumeMessage As Variant)
81-
'=> Referenz in m_ApplicationHandler auf Nothing setzen
82-
Set m_ApplicationHandler = Nothing
83-
End Sub
84-
85-
86-
'---------------------------------------------------------------------------------------
87-
' Ergänzungen für Erweiterung: AccUnitConfiguration
88-
'---------------------------------------------------------------------------------------
89-
90-
9137
Public Property Get ACLibConfig() As ACLibConfiguration
9238
If m_ACLibConfig Is Nothing Then
9339
Set m_ACLibConfig = New ACLibConfiguration
9440
End If
9541
Set ACLibConfig = m_ACLibConfig
9642
End Property
9743

98-
Private Sub GetExtensionPropertyLookup(ByVal PropertyName As String, ByRef ResumeMode As ApplicationHandlerResumeModes, ByRef ResumeMessage As Variant)
99-
100-
ResumeMode = AppResumeMode_Completed
101-
102-
Select Case PropertyName
103-
Case PROPNAME_ACCUNITDLLPATH
104-
ResumeMessage = AccUnitDllPath
105-
106-
Case Else 'Property wurde nicht erkannt
107-
ResumeMode = AppResumeMode_Error
108-
109-
End Select
110-
111-
End Sub
112-
11344
Public Property Get AccUnitDllPathPropertyName() As String
11445
AccUnitDllPathPropertyName = PROPNAME_ACCUNITDLLPATH
11546
End Property

0 commit comments

Comments
 (0)