---
title: ApplicationDataAccess
summary: API reference for the SAIF.Application.ApplicationDataAccess type.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-07-24
library: SAIF.Application
reference_type: package
---

# ApplicationDataAccess

`SAIF.Application.ApplicationDataAccess` wraps the library's data-portal plumbing. It stores connection settings and creates keyed SQL Server or Oracle `IDataPortalInfo` instances for use by application managers.

## Purpose
- Hold manager-supplied connection settings used to construct portal environments.
- Create and register keyed SQL Server and Oracle portal objects for downstream business operations.

## Context
- Namespace: `SAIF.Application`
- Assembly/package: `SAIF.BOF.Application`

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| `New` | `Public Sub New(Optional ByVal inBatchUserID As String = "")` | Instantiate the DataAccess object; when a batch user ID is supplied, construct the internal `clsDataAccess` with that batch user and set the environment `ClientID` to it, otherwise construct `clsDataAccess` with its default client ID. |
| `DAL` | `Public ReadOnly Property DAL() As IDataAccess` | Return the `IDataAccess` (DAL) instance associated with this application. |
| `DBUser` | `Public Property DBUser() As String` | Get or set the DBUser parameter of the connection. |
| `Database` | `Public Property Database() As String` | Get or set the Database parameter of the connection. |
| `Server` | `Public Property Server() As String` | Get or set the Server parameter of the connection. |
| `BatchID` | `Public Property BatchID() As String` | Get or set the BatchID (UserID) parameter of the connection. |
| `DPI` | `Public Property DPI(ByVal inKey As String) As IDataPortalInfo` | Get a previously registered portal by key (case-insensitive lookup); the `Set` accessor is `Friend`-scoped and adds the portal to the internal library if the key is not already registered. |
| `CreateSQLServerPortal` | `Public Sub CreateSQLServerPortal(ByVal inKey As String)` | Build a `clsSQLDataPortal` from the current connection properties (`DBUser`, `Database`, `Server`, `BatchID`) and register it in the DAL under the supplied key. |
| `CreateOraclePortal` | `Public Sub CreateOraclePortal(ByVal inKey As String)` | Build a `clsMSOracleDataPortal` from the current connection properties (`DBUser`, `Database`, `BatchID`) and register it in the DAL under the supplied key. |

## Behavioral notes
- Portal registration supports both SQL Server and Oracle without embedding SQL statements directly in the library.
- Registered portals back the manager and business-object flow described in `SAIF.Application` architecture documentation.

## Constraints and usage notes
- Connection properties must be populated by consuming code before portal creation occurs.
- The type manages `IDataPortalInfo` registration only; table mappings and SQL logic live in dependent business libraries.

## Sources
- `Application\SAIF.Application\ApplicationDataAccess.vb`
