Functions Class

Contains the public callable DB functions and helper functions

Inheritance Hierarchy

Namespace: DBaddinAssembly: DBaddin in (DBaddin.dll)

Syntax

public sealed class Functions

The Functions type exposes the following members.

Constructors

ClassSummary
private constructorFunctions()

Methods

NameSummary
public methodchainCells(Object[])
chains values contained in chainPart together with commas, mainly used for creating select header
private methodcheckParamsAndCache(ref Object, Object, Object)
checks calculation mode, query and cached status message.
private methodcheckQueryAndTarget(Object, Object)
checks Query and targetRange parameters for existence and return error message.
public methodconcatCells(Object[])
concatenates values contained in concatPart together (using .value attribute for cells)
public methodconcatCellsSep(String, Object[])
concatenates values contained in concatPart (using .value for cells) using a separator
public methodcurrentWorkbook(Boolean)
get current Workbook path + filename or Workbook path only, if onlyPath is set
public methodDBAddinEnvironment()
Get the current selected Environment for DB Functions
public methodDBAddinSetting(Object)
Get the settings as given in keyword (e.g. SERVER=) for the currently selected Environment for DB Functions
public methodDBDate(Object, Int32)
Create database compliant date, time or datetime string from excel date type value
public methodDBinClause(Object[])
Create an in clause from cell values, strings are created with quotation marks, dates are created with DBDate
public methodDBinClauseDate(Object[])
Create an in clause from cell values, strings are created with quotation marks, dates are created with DBDate
public methodDBinClauseStr(Object[])
Create an in clause from cell values, strings are created with quotation marks, dates are created with DBDate
public methodDBListFetch(Object, Object, Object, Object, Int32, Object, Object, Object, Object)
Fetches a list of data defined by query into TargetRange. Optionally copy formulas contained in FormulaRange, extend list depending on ExtendDataArea (0(default) = overwrite, 1=insert Cells, 2=insert Rows) and add field headers if HeaderInfo = TRUE
public methodDBListFetchAction(String, String, Range, Range, String, Object, Int32, Boolean, Boolean, Boolean, Boolean, String, String)
Actually do the work for DBListFetch: Query list of data delimited by maxRows and maxCols, write it into targetCells additionally copy formulas contained in formulaRange and extend list depending on extendArea
public methodDBRowFetch(Object, Object, Object[])
Fetches a row (single record) queried (defined in query) from DB (defined in ConnString) into targetArray
public methodDBRowFetchAction(String, String, Range, Object, String, Boolean)
Actually do the work for DBRowFetch: Query (assumed) one row of data, write it into targetCells
public methodDBSetPowerQuery(Object, Object)
Stores a query into an powerquery defined by queryName
public methodDBSetPowerQueryAction(String, String, Range, String)
set Query parameters (query text and connection string) of Query List or pivot table (incl. chart)
public methodDBSetQuery(Object, Object, Object)
Stores a query into an Object defined in targetRange (an embedded MS Query/List object, Pivot table, etc.)
public methodDBSetQueryAction(String, String, Range, String, Range, String)
set Query parameters (query text and connection string) of Query List or pivot table (incl. chart)
public methodDBString(Object[])
Create a database compliant string from cell values, potentially concatenating with other parts for easy inclusion of wildcards (%,_)
private methodDoConcatCellsSep(String, Boolean, Boolean, Boolean, Object[])
private function that actually concatenates values contained in Object array concatParts together (either using .text or .value for cells in concatParts) using a separator
private methodfinishAction(XlCalculation, String, String)
common for DBListFetch and DBRowFetch Action procedures to finish, resetting anything (Cursor, calc mode, status bar, screen updating) that was set otherwise...
private methodformatPQDate(Double, Boolean)
takes an OADate and formats it as a powerquery compliant #date, #time or #datetime function
public methodPQDate(Object, Boolean)
Creates a powerquery compliant #date function from excel date type value
public methodPQString(Object[])
Create a powerquery compliant string from cell values, potentially concatenating with other parts for easy inclusion of wildcards (%,_)
public methodpreventRefresh(Boolean)
set preventing of refreshing DB Functions
private methodsetCalcModeBack(XlCalculation)
private methodsetExtents(Range, ref String, ref String, ref String)
common for DBListFetch, DBRowFetch and DBSetQuery Action procedures, setting the Extent Names at the beginning
private methodToRange(Object)
converts ExcelDna (C API) reference to excel (COM Based) Range

Fields

NameDescription
public fieldavoidRequeryDuringEdit
public fieldconn
connection object
public fieldCurrConnString
connection string can be changed for calls with different connection strings
public fielddontCalcWhileClearing
avoid entering dblistfetch/dbrowfetch functions during clearing of list-fetch areas (before saving)
public fieldpreventRefreshFlag
avoid refreshing of DB Functions
public fieldqueryBackupColl
public fieldqueryCache
query cache for avoiding unnecessary recalculations/data retrievals by volatile inputs to DB Functions (now(), etc.)
public fieldStatusCollection
global collection of information transport containers between action function and user-defined function resp. calc event procedure