Module

DBKit Module

DBKit Module


Description

Shared constants and helper methods used by the DBKit controls.

Methods

Name

Parameters

Returns

Shared

Decamelcase

source As String

String

ErrorMessage

message As String, methodName As String

LocalizedMessage

msg As String, ParamArray values As String

String

Number

StringValue As String

Double

TableNameWithoutSchema

tableName As String

String

Constants

Name

Type

Description

DoubleQuote

String

A single double-quote character, for use when building or parsing strings that may contain quotes.

Version

String

Contains the DBKit version number.

XojoMinimumVersion

Double

The minimum version of Xojo required to use DBKit.

Method descriptions


DBKit.Decamelcase

Decamelcase(source As String) As String

Inserts spaces at case boundaries in source (for example "FirstName" becomes "First Name"). Strings that are entirely uppercase are returned unchanged.


DBKit.ErrorMessage

ErrorMessage(message As String, methodName As String)

Beeps and displays a message box with the text "DBKit Error in " followed by methodName, ": " and message.


DBKit.LocalizedMessage

LocalizedMessage(msg As String, ParamArray values As String) As String

Returns msg with each <$n> placeholder replaced by the corresponding value (<$1> is replaced by the first value, <$2> by the second, and so on).

Used to insert values into localizable message strings such as InvalidValueMessage.


DBKit.Number

Number(StringValue As String) As Double

Strips all characters from StringValue except digits, the minus sign and the locale's decimal separator, and returns the result as a Double.


DBKit.TableNameWithoutSchema

TableNameWithoutSchema(tableName As String) As String

Returns tableName with any schema prefix removed (for example "schema.table" becomes "table").

Notes

How display names are resolved

When a control needs a display name, for example in a message shown to the user, it uses the control's DisplayName if one is set. Otherwise it uses the column name, falling back to the control's own name, with camel case converted to separate words. Names that are entirely uppercase are left unchanged.

Transactions

Only one SQL transaction can be in progress at a time per connection, so DBKit prevents the user from editing more than one row at a time. If your own code starts transactions, check your DatabaseConnection object's IsTransactionActive first so that your code and DBKit's code do not try to start a transaction when one is already active.

Compatibility

Project Types

Desktop, Web

Operating Systems

All