@@ -191,10 +191,6 @@ Begin Form
191
191
PressedColor =9262658
192
192
HoverForeColor =4210752
193
193
PressedForeColor =4210752
194
- WebImagePaddingLeft =2
195
- WebImagePaddingTop =2
196
- WebImagePaddingRight =1
197
- WebImagePaddingBottom =1
198
194
Overlaps =1
199
195
End
200
196
Begin ListBox
@@ -327,10 +323,6 @@ Begin Form
327
323
PressedColor =9262658
328
324
HoverForeColor =4210752
329
325
PressedForeColor =4210752
330
- WebImagePaddingLeft =2
331
- WebImagePaddingTop =2
332
- WebImagePaddingRight =1
333
- WebImagePaddingBottom =1
334
326
Overlaps =1
335
327
End
336
328
Begin Label
@@ -398,146 +390,146 @@ Public Sub cmdRunTests_Click()
398
390
Dim intTest As Integer
399
391
Dim dbs As DAO .Database
400
392
Dim rsc As SharedResource
401
-
393
+
402
394
Set dbs = CurrentDb
403
-
395
+
404
396
' Clear list and totals
405
397
lstResults.RowSource = ""
406
398
m_Totals(True ) = 0
407
399
m_Totals(False ) = 0
408
-
400
+
409
401
' Ignore any errors.
410
402
' NOTE: don't include the test result on a line that may throw an error.
411
403
On Error Resume Next
412
-
404
+
413
405
' Update linked tables/CSV to use the current directory
414
406
dbs.TableDefs("tblLinkedAccess" ).Connect = ";DATABASE=" & Application.CurrentProject.Path & "\Testing.accdb"
415
407
dbs.TableDefs("tblLinkedAccess" ).RefreshLink
416
408
dbs.TableDefs("tblLinkedCSV" ).Connect = "Text;DSN=Linked Link Specification;FMT=Delimited;HDR=NO;IMEX=2;CharacterSet=437;ACCDB=YES;DATABASE=" & Application.CurrentProject.Path
417
409
dbs.TableDefs("tblLinkedCSV" ).RefreshLink
418
-
410
+
419
411
'========================
420
412
' BEGIN TESTS
421
413
'========================
422
-
414
+
423
415
' Tables
424
416
strTest = dbs.TableDefs("tblInternal" ).Name
425
417
ShowResult "Access Table exists" , (strTest = "tblInternal" )
426
-
418
+
427
419
intTest = 0
428
420
intTest = DCount("*" , "tblInternal" )
429
421
ShowResult "tblInternal has data" , (intTest > 0 )
430
-
422
+
431
423
strTest = dbs.TableDefs("tblLinkedCSV" ).Name
432
424
ShowResult "Linked Table exists" , (strTest = "tblLinkedCSV" )
433
425
434
426
intTest = 0
435
427
intTest = DCount("*" , "tblLinkedCSV" )
436
428
ShowResult "tblLinkedCSV has data" , (intTest > 0 )
437
-
429
+
438
430
ShowResult "Saved Table Data (TDF)" , FSO.FileExists(ExportFolder & "tables\tblInternal.txt" )
439
-
431
+
440
432
ShowResult "Saved Table Data (XML)" , FSO.FileExists(ExportFolder & "tables\tblSaveXML.xml" )
441
-
433
+
442
434
ShowResult "Table SQL" , FSO.FileExists(ExportFolder & "tbldefs\tblInternal.sql" )
443
435
444
436
ShowResult "Linked Table JSON" , FSO.FileExists(ExportFolder & "tbldefs\tblLinkedCSV.json" )
445
-
437
+
446
438
ShowResult "Linked Table structure" , FSO.FileExists(ExportFolder & "tbldefs\tblLinkedCSV.sql" )
447
439
448
440
intTest = 0
449
441
intTest = dbs.Relations("tblInternaltblSaveXML" ).Fields.Count
450
442
ShowResult "Table Relationship" , (intTest = 1 )
451
-
443
+
452
444
intTest = 0
453
445
intTest = DCount("*" , "MSysObjects" , "Not IsNull(LvExtra) and Type = 1 and [Name] = 'tblSaveXML'" )
454
446
ShowResult "Table Data Macro Exists" , (intTest > 0 )
455
-
456
-
447
+
448
+
457
449
' Queries
458
450
strTest = dbs.QueryDefs("qryNavigationPaneGroups" ).Name
459
451
ShowResult "Query exists" , (strTest = "qryNavigationPaneGroups" )
460
-
461
-
452
+
453
+
462
454
' Forms
463
455
strTest = CurrentProject.AllForms("frmMain" ).Name
464
456
ShowResult "Form exists" , (strTest = "frmMain" )
465
-
466
-
457
+
458
+
467
459
' Reports
468
460
strTest = CurrentProject.AllReports("rptNavigationPaneGroups" ).Name
469
461
ShowResult "Report exists" , (strTest = "rptNavigationPaneGroups" )
470
462
ShowResult "Landscape Orientation" , (Report_rptNonDefaultPaperSize.Printer.Orientation = acPRORLandscape)
471
463
ShowResult "A4 Paper Size" , (Report_rptNonDefaultPaperSize.Printer.PaperSize = acPRPSA4)
472
-
473
-
464
+
465
+
474
466
' Macros
475
467
strTest = CurrentProject.AllMacros("AutoExec" ).Name
476
468
ShowResult "Macro exists" , (strTest = "AutoExec" )
477
-
478
-
469
+
470
+
479
471
' Modules
480
472
strTest = CurrentProject.AllModules("basUtility" ).Name
481
473
ShowResult "Standard Module exists" , (strTest = "basUtility" )
482
474
strTest = GetVBProjectForCurrentDB.VBComponents("basExtendedChars" ).CodeModule.Lines(6 , 1 )
483
475
ShowResult "Extended ASCII text in VBA" , (Mid$(strTest, 10 , 1 ) = Chr(151 ))
484
-
476
+
485
477
strTest = CurrentProject.AllModules("clsPerson" ).Name
486
478
ShowResult "Class Module exists" , (strTest = "clsPerson" )
487
-
488
-
479
+
480
+
489
481
' Database properties
490
482
strTest = ""
491
483
strTest = dbs.Properties("AppIcon" )
492
484
ShowResult "Application Icon is set" , (Len(strTest) > 5 )
493
485
494
486
strTest = dbs.Properties("DAOProperty" ).Value
495
487
ShowResult "Custom Database (DAO) property" , (strTest = "DAO" )
496
-
488
+
497
489
strTest = CurrentProject.Properties("ProjectProperty" ).Value
498
490
ShowResult "Custom Project Property" , (strTest = "TestValue" )
499
-
491
+
500
492
strTest = dbs.Containers("Databases" ).Documents("SummaryInfo" ).Properties("Title" )
501
493
ShowResult "Database Summary Property (Title)" , (strTest = "VCS Testing" )
502
-
494
+
503
495
strTest = dbs.Containers("Tables" ).Documents("tblSaveXML" ).Properties("Description" )
504
496
ShowResult "Navigation pane object description" , (strTest = "Saved description in XML table." )
505
-
497
+
506
498
strTest = dbs.Containers("Modules" ).Documents("basUtility" ).Properties("Description" )
507
499
ShowResult "Module description" , (strTest = "My special description on the code module." )
508
-
500
+
509
501
ShowResult "Saved shared images" , (CurrentProject.Resources.Count > 2 )
510
-
502
+
511
503
ShowResult "Saved import/export specs (XML)" , (CurrentProject.ImportExportSpecifications.Count > 0 )
512
-
504
+
513
505
strTest = CurrentProject.ImportExportSpecifications(0 ).Name
514
506
ShowResult "Name of saved specification" , (strTest = "Export-MSysIMEXColumns" )
515
-
507
+
516
508
strTest = Nz(DLookup("SpecName" , "MSysIMEXSpecs" , "SpecName=""Test 2""" ))
517
509
ShowResult "Saved IMEX spec (Table based)" , (strTest = "Test 2" )
518
-
510
+
519
511
strTest = Nz(DLookup("Name" , "MSysNavPaneGroups" , "Name=""My Modules""" ))
520
512
ShowResult "Custom navigation pane group" , (strTest = "My Modules" )
521
-
513
+
522
514
' VBE Project
523
515
With GetVBProjectForCurrentDB
524
-
516
+
525
517
ShowResult "VBE project name" , (.Name = "VCS Testing" )
526
518
ShowResult "VBE project description" , (.Description = "For automated testing of Version Control" )
527
519
ShowResult "Help context id" , (.HelpContextId = 123456 )
528
-
520
+
529
521
strTest = .References("Scripting" ).Name
530
522
ShowResult "GUID reference (scripting)" , (strTest = "Scripting" )
531
-
523
+
532
524
strTest = .References("MSForms" ).Name
533
525
ShowResult "MS Forms 2.0 reference" , (strTest = "MSForms" )
534
-
526
+
535
527
End With
536
-
528
+
537
529
' Theme
538
530
strTest = CurrentDb.Properties("Theme Resource Name" )
539
531
ShowResult "Active theme = Angles" , (strTest = "Angles" )
540
-
532
+
541
533
strTest = vbNullString
542
534
For Each rsc In CurrentProject.Resources
543
535
If rsc.Type = acResourceTheme Then
@@ -546,26 +538,26 @@ Public Sub cmdRunTests_Click()
546
538
End If
547
539
Next rsc
548
540
ShowResult "Theme resource exists" , (strTest = "Angles" )
549
-
541
+
550
542
' Other
551
543
ShowResult "VCS Options file exists" , FSO.FileExists(ExportFolder & "vcs-options.json" )
552
-
553
-
544
+
545
+
554
546
'========================
555
547
' END TESTS
556
548
'========================
557
-
549
+
558
550
' Display results
559
551
lblResults.Caption = _
560
552
m_Totals(True ) & " tests passed" & vbCrLf & _
561
553
m_Totals(False ) & " tests failed"
562
-
554
+
563
555
If m_Totals(False ) = 0 Then
564
556
imgResult.Picture = "button_ok"
565
557
Else
566
558
imgResult.Picture = "button_error"
567
559
End If
568
-
560
+
569
561
If Err Then Err.Clear
570
562
571
563
End Sub
0 commit comments