VBAuth Demo Database — User Manual: Free Demo System #
VBAuth | Corylus Business Systems & The IT Service Ltd
This manual covers the VBAuth Free Demo Access database. It is written for Access developers who are new to VBAuth and want to evaluate it before purchasing a development licence. The free demo provides a working, licenced instance of VBAuth with four feature tabs so you can see it authenticate against Microsoft Graph and return real data without writing any code.
| Property | Value |
|---|---|
| Product | VBAuth Demo Database – Free Demo System |
| Scope | Four feature tabs: Send Email, Validate Contacts, AAD Group Membership, Booking Appointments |
| Audience | Access developers evaluating VBAuth |
| Version | 2025–2026 (Corylus Business Systems / The IT Service Ltd) |
| Licence | MIT – see LICENCE.txt in the project root |
1. Overview #
The VBAuth Free Demo is a self-contained Microsoft Access application that demonstrates four Microsoft Graph API features using the VBAuth DLL. Everything runs against your own Microsoft 365 tenant with your own Azure Entra app registrations. No sample data is used; the results you see are live data from your tenant.
Online documentation and downloads. The authoritative and most current documentation for VBAuth is published at vbauth.com. If anything in this manual conflicts with the online documentation, the online version takes precedence as it is updated first. Sample code in both the demo database and the online documentation is released under the MIT Licence; the same restrictions apply to both sources.
1.1 Key concepts #
AppID – every Graph API feature in the demo is assigned a unique integer identifier stored in the lclVBAuthAdmin table. The AppID drives all authentication: SetEntraAPPIdValues reads the record for the current AppID to obtain the Client ID, Tenant ID, scopes, HTTP verb, and URL.
lclVBAuthAdmin – the single configuration table. One row per AppID. AppID=1 (Who Am I) is configured through the Setup Wizard and is required before the demo can run any feature. AppIDs 3–6 represent the four feature tabs and are configured individually on the main form.
Shared registrations – AppIDs 3 and 4 (Validate Contacts and Send Email) share a single Azure app registration because they require exactly the same set of Graph permission scopes. Configuring either one automatically propagates the Client ID to the other. See Section 4 for the complete mapping.
1.2 What the free demo is NOT #
The free demo is not the full VBAuth demo database. The complete demo (available to development licence holders at vbauth.com) contains 20 feature tabs covering the full range of Microsoft Graph capabilities. The free demo is a representative subset – four features that are immediately useful and straightforward to set up – intended to let you evaluate VBAuth with minimal friction.
The demo is not a production application. It is a teaching tool and a code-extraction source. You are expected to take the modules and patterns that are relevant to your project, not deploy the demo as-is.
2. Prerequisites #
2.1 VBAuth DLL installation #
The VBAuth installer handles bitness selection automatically and installs the correct DLL for your Office installation. Under normal circumstances no manual bitness decision is required.
If you change Office bitness (e.g. move from 32-bit to 64-bit Office, or vice versa) you must uninstall VBAuth and reinstall it so the installer can deploy the correct DLL for the new bitness. Your licence file (.LIC) remains on disk and will continue to work after reinstallation — you do not need a new licence.
2.2 VBA reference #
After opening the database in Access, open the VBE (Alt+F11), go to Tools > References, and ensure VBAuth appears and is ticked. The expected path is:
C:\Program Files\VBAuth\Graph Authenticator\VBAuth.tlb
Code language: CSS (css)
If the reference shows as Missing, re-run the VBAuth installer, then remove the broken reference and re-add from the path above.
2.3 Licence file #
A valid VBAuth licence file (.LIC) must be present and accessible. The Setup Wizard Step 3 checks for the licence before allowing a connection test. If the check fails, visit vbauth.com to obtain or renew your licence.
2.4 Microsoft 365 tenant #
You require access to an M365 / Azure Entra tenant in which you have, or can arrange, sufficient privileges to create app registrations. Application Administrator or Global Administrator rights are needed for the initial registration steps. When a feature is run for the first time, Microsoft’s sign-in flow will display a permissions consent screen to the user. For scopes that require only user-level permissions, the user can grant consent themselves. For scopes that require admin-level permissions, an administrator must either grant consent on behalf of the organisation (via the API Permissions blade in the Azure portal for that app registration) or be the user signing in when consent is first requested. Which scopes fall into which category is determined by Microsoft and varies by scope; the Azure portal API Permissions blade indicates the consent type required for each permission.
3. First Run – Setup Wizard #
When the database opens for the first time it goes through a startup sequence before landing on the main feature form.
3.1 frmStartup – DLL check #
The very first form that loads (frmStartup) attempts to instantiate VBAuth.GraphAuthenticator via CreateObject. If this fails, Access quits immediately with a diagnostic message that names the bitness mismatch, missing installation, or COM registration failure as the likely cause. No user action is required on this form; it is purely a guard. After a brief pause it opens frmSetupWizard and closes itself.
3.2 frmSetupWizard – three pages #
The wizard has three pages controlled by a simple integer counter (mintCurrentPage). If AppID=1 already has a Client ID and Tenant ID stored (i.e. the database has been used before), the wizard skips directly to page 2.
Page 1 – Create your Azure App Registration
Instructions are displayed inside a locked text box. The Open Azure Portal button navigates to the App Registrations blade of the Azure portal. You must create a new registration manually with the following settings:
| Setting | Required value |
|---|---|
| Name | Any meaningful name, e.g. VBAuth – Who Am I |
| Supported account types | Single tenant (your organisation only) |
| Redirect URI platform | Public client/native (mobile & desktop) |
| Redirect URI value | http://localhost |
Critical step: Before navigating away from the Overview blade after clicking Register, copy both the Application (Client) ID and the Directory (Tenant) ID. You cannot return to retrieve the Client ID without navigating back to the registration.
No API permissions need to be configured on this registration. The Who Am I feature uses only the standard openid, profile, and User.Read scopes which are granted by default.
Page 2 – Enter your Application IDs
Paste the Application (Client) ID and Directory (Tenant) ID into the two text boxes. Both are validated as GUIDs (format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) before the wizard allows you to proceed. Clicking Next saves the values to lclVBAuthAdmin AppID=1 and propagates the Tenant ID to every other record in the table.
Page 3 – Test your connection
The wizard runs pre-flight checks in sequence:
| Check | What it verifies |
|---|---|
| Dependencies | VBAuth DLL reference is present and not broken; COM instantiation succeeds |
| Licence files | Required .LIC file is present and accessible |
| Licence validity | Licence has not expired and matches the registered tenant |
If all checks pass, the Test Connection button becomes visible. Clicking it calls the Who Am I feature, which opens a Microsoft sign-in browser window. Sign in with a user account in your tenant. On success the authenticated user’s display name, UPN, and job title are shown in the result text box and the Finish button appears. Clicking Finish opens frmFeatureDemo.
If the setup wizard is re-opened on a database that is already configured, the Reset button clears all Client IDs and Tenant IDs across the entire lclVBAuthAdmin table and returns to page 1. This is destructive – use it only to start over completely.
4. AppID Reference Table #
The table below lists every AppID in lclVBAuthAdmin, the Azure app registration it represents, the Graph permission scope(s) it requires, and the tab it appears on in frmFeatureDemo. AppIDs 3 and 4 share the same Azure app registration; both are shown and the pairing is noted.
| AppID | Feature / Registration name | Scope(s) | Tab / Notes |
|---|---|---|---|
| 1 | VBAuth – Who Am I | openid, profile, User.Read | Setup Wizard only |
| 3 | VBAuth – Send Email and Validate Contacts | Contacts.Read, Mail.ReadWrite, Mail.Send, User.Read | Validate Contacts tab; shared with AppID=4 |
| 4 | VBAuth – Send Email and Validate Contacts | Contacts.Read, Mail.ReadWrite, Mail.Send, User.Read | Send Email tab; shared with AppID=3 |
| 5 | VBAuth – AAD Groups | GroupMember.Read.All | AAD Group Membership tab |
| 6 | VBAuth – Bookings | BookingsAppointment.ReadWrite.All | Booking Appointments tab |
Shared registrations note. When two AppIDs share the same Azure app registration, configuring either one automatically writes the Client ID and Tenant ID to the other record as well. You only need to click Configure once for each pair.
5. Main Form – frmFeatureDemo #
frmFeatureDemo is the central hub of the demo. It contains a four-page tab control (tabFeatures), a Wipe button, and a log-file button. Everything of consequence in the demo happens here.
5.1 Tab layout #
The tab control has four pages, one per feature:
| Tab index | Feature | AppID(s) |
|---|---|---|
| 0 | Validate Contacts | 3 |
| 1 | Send Email | 3 and 4 (shared registration) |
| 2 | AAD Group Membership | 5 |
| 3 | Booking Appointments | 6 |
5.2 Status labels #
Every tab has a status label at the top. It reads either:
| Colour | Meaning |
|---|---|
| Green | Configured – a Client ID is stored in lclVBAuthAdmin for this feature’s AppID |
| Red | Not configured – click the Configure button on this tab to set it up |
The action button for each feature is disabled until the feature is configured.
5.3 Open Log File button #
The Open Log File button opens the VBAuth DLL diagnostic log in Notepad. The log path is:
%TEMP%\VBAuth.log
Code language: CSS (css)
The file is created on first use of the DLL. If it does not yet exist, a message is displayed rather than an error. This log is the first place to look when a feature fails – it contains the raw JSON returned by the Graph API and any DLL-level error messages.
5.4 Wipe button #
The Wipe button clears all Client IDs and Tenant IDs from every row in lclVBAuthAdmin, then compacts and quits Access. This returns the database to a completely blank first-run state. After a Wipe the Setup Wizard must be completed again from page 1.
The Wipe operation is irreversible. It does NOT delete app registrations from Azure — those must be deleted manually from the Azure portal if required.
6. frmConfigureFeature – Manual Configuration #
frmConfigureFeature is the manual configuration path for any feature. It is opened as a modal dialogue from each tab’s Configure button, passing OpenArgs = "AppID=n". On load it reads the record from lclVBAuthAdmin and displays the feature name, required scope claims, and current Tenant ID.
The form shows step-by-step instructions for creating the registration manually in the Azure portal. After pasting the Client ID and clicking Save:
| Outcome | What happens |
|---|---|
| GUID format valid | Client ID is saved to lclVBAuthAdmin for this AppID |
| Matching scopes found on unpopulated peers | Client ID is automatically propagated to all other records with identical scope claims that do not yet have a Client ID |
| Save confirmed | Form closes and the calling tab’s Refresh method updates the status label |
For AppIDs 3 and 4 (Validate Contacts and Send Email), configuring either one configures both. The Configure button on either tab opens frmConfigureFeature for the tab’s own AppID, and the propagation logic copies the Client ID to the peer automatically on Save.
7. Feature Tabs – Operation #
Each feature tab follows the same pattern. A status label shows whether it is configured. A Configure button opens frmConfigureFeature for manual Client ID entry. An action button runs the feature. A result text box displays the output.
7.1 Validate Contacts (AppID = 3) #
Checks a list of email addresses against the signed-in user’s Outlook contacts to verify they exist. Enter comma- or semicolon-separated addresses in the To, CC, and BCC fields, then click Check Addresses in Contacts. Results show which addresses were found and which were not.
This feature is also accessible from the Send Email tab via a dedicated Validate Contacts button there, allowing you to validate recipients before sending.
This checks your Exchange mailbox contacts folder only, not the Global Address List. Addresses missing from your personal contacts are flagged as advisory — you can still send to them.
7.2 Send Plain Email (AppIDs 3 and 4) #
Sends an email from the signed-in user’s mailbox. To, CC, and BCC accept comma- or semicolon-separated SMTP addresses. All addresses are format-validated before the Graph call is made.
| Field | Notes |
|---|---|
| To | Required. One or more SMTP addresses, comma- or semicolon-separated |
| CC | Optional. Same format as To |
| BCC | Optional. Same format as To |
| Subject | Required |
| Body | Required. Plain text unless Body is HTML is ticked |
| Body is HTML | Tick to send rich-text HTML content. The body text box must contain valid HTML |
| Save to Sent Items | Ticked by default. Untick to suppress saving to the Sent Items folder |
AppIDs 3 and 4 share one Azure registration. Configuring Send Email also configures Validate Contacts and vice versa.
7.3 AAD Group Membership (AppID = 5) #
Lists all Entra ID (Azure AD) groups of which the signed-in user is a direct member, sorted alphabetically. Group count is shown in a label below the result box. Security groups, Microsoft 365 groups, and distribution groups are all included.
Only direct memberships are returned. Groups the user belongs to via nested group membership are not included.
7.4 Booking Appointments (AppID = 6) #
Retrieves upcoming appointments from a Microsoft Bookings calendar. The Bookings calendar address field requires the SMTP address of the Bookings business mailbox (e.g. myshop@contoso.onmicrosoft.com). This address is validated as a properly formed email address before the Graph call is made.
Results show the appointment start date and time, customer name, and service name for each upcoming booking.
The signed-in user must have access to the specified Bookings calendar. If not, Graph returns an authorisation error.
8. Code Architecture #
8.1 Module inventory #
| Module | Role |
|---|---|
| modVBAuthGlobalConstants | Public globals (intAppID, strClientID, strTenantID, strBearerToken, etc.); SetEntraAPPIdValues; AcquireBearerToken; token caching; AreScopesSubset; NormaliseScopeClaims; FindSharedRegistration; GetVBAuthLogPath |
| modStartup | CheckVBAuthInstallation; IsSetupRequired – called from frmSetupWizard.Form_Load |
| modCurrentUser | WhoAmI – called from the Setup Wizard test connection step |
| modSendEmail | SendEmail; BuildSendMailPayload; BuildRecipientArray; JsonEscape |
| modValidateContacts | ValidateContactAddresses; CheckAddressList; ContactExists |
| modGetMyGroups | GetMyGroups; SortGroupList |
| modGetBookingAppointments | GetBookingAppointments |
| modResetAndDelete | ResetAndDelete – local credential wipe only; no Azure deletion |
| modVBAuthTesting | Development testing utilities – not required in production extraction |
| JSONConverter | Tim Hall VBA-JSON v2.3.1 – ParseJson; used by all modules that parse Graph API responses |
8.2 Authentication flow #
Every feature module follows the same two-step authentication pattern:
| Step | Code | Description |
|---|---|---|
| 1 | intAppID = n then SetEntraAPPIdValues() | Reads the lclVBAuthAdmin record for this AppID and populates the global variables: strClientID, strTenantID, strScopeRequested, strGraphAPI_URL, strGraphAPI_Verb, lngHTTPTimeout |
| 2 | AcquireBearerToken(strClientID, strTenantID, strScopeRequested) | Calls the VBAuth DLL. If a cached token exists, covers the required scopes, and has not expired, it is reused without prompting. Otherwise the DLL opens a browser window for the user to sign in. On success, strBearerToken and datBearerExpiry are populated. |
The bearer token is then included as the Authorization header in every MSXML2.ServerXMLHTTP.6.0 call.
8.3 Token caching #
The token cache in AcquireBearerToken is session-scoped (module-level globals). A cached token is reused if:
| Condition | Check |
|---|---|
| Token is present | strBearerToken <> "" |
| Not expired | datBearerExpiry > Now() |
| Scopes are a subset | Every scope in the new request exists in the cached strCachedClaims (AreScopesSubset, case-insensitive) |
If any condition fails, the token is discarded and a new one is requested. Because AppIDs 3 and 4 share the same scopes and Client ID, a token acquired for Send Email is automatically reused for Validate Contacts and vice versa.
8.4 HTTP calls #
All Graph API calls use MSXML2.ServerXMLHTTP.6.0. Four timeouts (resolve, connect, send, receive) are all set to lngHTTPTimeout milliseconds, which is read from the WaitForLogin column of lclVBAuthAdmin (defaulting to 60,000 ms if null). GET requests carry no body. POST requests set Content-Type to application/json and send a manually constructed JSON string as the payload.
8.5 JSON parsing #
All Graph API response parsing uses JSONConverter (Tim Hall’s VBA-JSON v2.3.1). The parsed object is a VBA Collection hierarchy. String fields are accessed by key name; nested objects and arrays by index (1-based). Each module includes a private helper to return an empty string rather than raising an error if a key is absent.
8.6 modResetAndDelete – free demo differences #
The free demo’s modResetAndDelete is considerably simpler than its equivalent in the complete demo. It performs a local-only reset: it clears the ClientID and TenantID columns from every row in lclVBAuthAdmin using a single SQL UPDATE statement, then compacts and quits Access. It does not attempt to delete any app registrations from Azure.
This is intentional: the free demo has no AppID=2 registration with Application.ReadWrite.All privileges, so Azure deletion is outside its scope.
9. lclVBAuthAdmin – Configuration Table #
This table is the sole source of configuration for all authentication and API calls in the demo. It is a local (non-linked) Access table. The prefix lcl denotes local; it is never linked or exported.
| Field | Type | Purpose |
|---|---|---|
| AppID | Integer (PK) | Unique identifier for this feature/registration |
| ActionName | Text | Display name used in UI labels |
| Verb | Text | HTTP verb: GET or POST |
| URLPart1 | Text | Base URL or first segment of the Graph endpoint |
| URLPart2 | Text | Final segment (optional); appended after any runtime parameter |
| URLPart3 | Text | Further segment (optional) |
| ScopeClaims | Text | Comma-separated list of required delegated permission scope names |
| ClientID | Text | Azure Application (Client) ID GUID – blank until configured |
| TenantID | Text | Azure Directory (Tenant) ID GUID – propagated from AppID=1 |
| WaitForLogin | Integer | HTTP timeout in seconds (default 60); multiplied by 1,000 for MSXML2 |
The free demo lclVBAuthAdmin does not include an ObjectID column. The ObjectID field present in the complete demo is used for App Role assignment operations that are not part of the free demo.
10. Shared Registrations – Detail #
AppIDs 3 and 4 share a single Azure app registration because they require exactly the same set of Graph permission scopes: one Azure app can serve both calls. The database detects sharing by normalising (sorting alphabetically, trimming whitespace) and comparing scope claim strings.
| Shared pair | AppIDs | Reason for sharing |
|---|---|---|
| Send Email and Validate Contacts | 3, 4 | Both require Contacts.Read, Mail.ReadWrite, Mail.Send, User.Read |
11. Extracting Features for Your Own Database #
The demo is designed to be mined for components. For each feature you wish to use, the minimum set of objects to copy is:
| Object to copy | Notes |
|---|---|
| modVBAuthGlobalConstants | Always required – contains globals, SetEntraAPPIdValues, AcquireBearerToken, and helper functions |
| JSONConverter | Always required for any feature that parses JSON responses |
| The feature module(s) | e.g. modSendEmail for email; modGetMyGroups for group membership |
| lclVBAuthAdmin record(s) | Copy the relevant AppID row(s) into your own lclVBAuthAdmin table. If your database already has VBAuth rows, add only the new ones. |
You do NOT need to copy the form code, the setup wizard, or frmConfigureFeature into a production application. Those exist to make the demo self-configuring. In a production application you will populate lclVBAuthAdmin at install time with known Client IDs and Tenant IDs.
11.1 Minimum viable extraction example #
To add “Send Plain Email” to an existing VBA application:
| Step | Action |
|---|---|
| 1 | Copy modVBAuthGlobalConstants and JSONConverter into your database |
| 2 | Copy modSendEmail and modValidateContacts (if contact validation is wanted) |
| 3 | Create lclVBAuthAdmin in your database with the standard field structure |
| 4 | Add rows for AppID=3 and AppID=4 with your known Client ID and Tenant ID |
| 5 | In your form code: set intAppID = 4, call SetEntraAPPIdValues, call AcquireBearerToken, then call BuildSendMailPayload and SendEmail |
12. Granting Admin Consent #
Admin consent pre-authorises the requested Graph permissions for the entire organisation, so that users are not prompted individually when the scope requires admin-level authorisation. For scopes requiring only user-level consent, individual users can grant consent themselves at sign-in. For admin-level scopes, an administrator must either grant consent organisation-wide via the Azure portal, or be present as the signing-in user when consent is first requested.
To grant admin consent for an app registration:
| Step | Action |
|---|---|
| 1 | In the Microsoft Entra admin centre, navigate to Identity > Applications > App registrations |
| 2 | Select the app registration (e.g. VBAuth – Send Email and Validate Contacts) |
| 3 | Click API permissions in the left menu |
| 4 | Verify all required delegated permissions are listed under Configured permissions |
| 5 | Click Grant admin consent for [your organisation name] |
| 6 | Confirm when prompted. The status column changes to green ticks. |
Repeat for each app registration. If a permission was added after the initial registration, you must return to this blade and grant consent again.
13. Troubleshooting #
| Symptom | Likely cause and fix |
|---|---|
| Access quits immediately on open | VBAuth DLL failed to load. Check bitness match, installation path, and COM registration. Run RegAsm from an elevated prompt using the correct Framework path for your Office bitness. |
| Setup Wizard shows “VBAuth reference is broken” | The TLB path referenced in Tools > References no longer exists. Remove the broken reference, re-install VBAuth, then re-add the reference from C:\Program Files\VBAuth\Graph Authenticator\VBAuth.tlb. |
| Licence check fails on wizard page 3 | The .LIC file is absent, in the wrong location, or has expired. Contact Corylus Business Systems. |
| “There is no record in lclVBAuthAdmin for AppID n” | The configuration table is missing the expected row. Import a fresh copy of lclVBAuthAdmin from the demo database or add the row manually. |
| “The scope claims is missing” during SetEntraAPPIdValues | The ScopeClaims field is blank for this AppID. Check lclVBAuthAdmin. |
| Feature button disabled, status label red | The Client ID has not been set for this AppID. Use the Configure button on the tab. |
| Graph call returns 401 Unauthorized | Token has expired or scopes are insufficient. Re-authentication will be prompted on the next call. If the error persists, verify admin consent has been granted for all required scopes in the Azure portal. |
| Graph call returns 403 Forbidden | Admin consent has not been granted, or the signed-in user does not have the necessary M365 licence for the feature (e.g. no Bookings licence for the Bookings tab). |
| Bookings returns no appointments | Verify the calendar address is the Bookings business mailbox address, not a staff member address. Also verify the signed-in user has read access to that Bookings calendar. |
| Send Email fails with 400 Bad Request | Inspect the raw JSON payload in the VBAuth log. Common causes: malformed email address in the recipient list or a missing required field. |
| Contact validation returns unexpected results | This check queries your personal Exchange contacts folder only, not the Global Address List. Addresses not in your personal contacts will be reported as not found regardless of whether they are valid M365 users. |
Appendix A – Form and Module Quick Reference #
| Name | Type | Purpose |
|---|---|---|
| frmStartup | Form | DLL instantiation guard; brief pause then hands off to frmSetupWizard |
| frmSetupWizard | Form | 3-page wizard: create Who Am I app, enter IDs, test connection |
| frmFeatureDemo | Form | Main hub; 4-tab tab control; all feature UI; Wipe button |
| frmConfigureFeature | Form | Modal; manual Client ID entry for any AppID |
| modVBAuthGlobalConstants | Module | Core globals and authentication functions |
| modStartup | Module | DLL and setup checks called from wizards |
| modCurrentUser | Module | Who Am I – setup wizard test connection |
| modSendEmail | Module | Plain email send; payload builder; recipient array builder; JsonEscape |
| modValidateContacts | Module | Email address contact validation against Exchange contacts |
| modGetMyGroups | Module | Entra ID group membership listing with alphabetical sort |
| modGetBookingAppointments | Module | Bookings appointment retrieval |
| modResetAndDelete | Module | Local credential wipe only (no Azure deletion in free demo) |
| modVBAuthTesting | Module | Dev testing utilities – not required in production |
| JSONConverter | Module | VBA-JSON parser (Tim Hall v2.3.1) |
VBAuth, developed and maintained by Andrew Richards (The IT Service Ltd) and Peter Bryant (Corylus Business Systems), © 2025–2026. All rights reserved. https://vbauth.com