A centralized ADO execution framework for Microsoft Access applications connected to SQL Server or Azure SQL.
Every ADO call in a large Access/SQL application requires the same boilerplate: open connection, create command, set command type, append parameters, execute, clean up. Across hundreds of procedures this becomes a maintenance liability. mSQL centralizes all of this into a single reusable module.
Global ADO Command executor. Accepts command text (SQL statement or stored procedure name), command type, execution method, and parameters via ParamArray using ADOParam helpers. Supports two execution modes:
- emOrigin: execute immediately within SQLCmdGlobal
- emCaller: set up command and parameters only; calling procedure handles execution
Helper function that builds a parameter array for passing to SQLCmdGlobal. Supports all ADO data types including adDecimal with precision and scale validation.
Wrapper for single-value scalar lookups. Enforces SELECT-only queries, returns the first column of the first row, and raises an error if multiple rows are returned — preventing silent data integrity issues.
Handles connection validation, command instantiation, parameter clearing, and connection assignment. Automatically opens the global connection if not already open.
Global connection manager. Checks connection state before re-instantiating to prevent redundant connections.
- ByRef Cmd parameter allows command object to be reused or inspected by the calling procedure after execution
- ADOParamResolve handles both direct calls and wrapper function calls transparently — flattening nested ParamArrays
- Parameter validation catches zero-length string types, invalid decimal precision/scale, and malformed param arrays before they reach SQL Server
- Named parameters enabled for stored procedures only
Microsoft ActiveX Data Objects (ADODB) reference Global ADOConnect connection string variable Global error handler (ReportExcept)