Platforms to show: All Mac Windows Linux Cross-Platform

Back to SQLGlobalsMBS class.

SQLGlobalsMBS.FindTableName(SQL as String) as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SQL MBS SQL Plugin 21.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Queries table name used in a SQL SELECT statement.
Example
Var sql As String = "SELECT First, Last FROM MyTable WHERE ID = 1"
Var TableName As String = SQLGlobalsMBS.FindTableName(sql)

MessageBox TableName // shows MyTable

This is a helper function used by our Edit/Update methods in RecordSet.
Returns either the found table name or empty text if something got wrong. e.g. multiple tables affected due to JOIN operation.

If you find a case where the parser crashes or reports wrong result, please contact us.

SQLGlobalsMBS.GetEnv(name as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SQL MBS SQL Plugin 13.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Queries environment variable.

Returns empty string if variable is undefined.

SQLGlobalsMBS.GetVersion as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SQL MBS SQL Plugin 14.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The version string of the SQLAPI library.

SQLGlobalsMBS.GetVersionBuild as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SQL MBS SQL Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The build number of the SQLAPI library.

SQLGlobalsMBS.GetVersionMajor as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SQL MBS SQL Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The major version number of the SQLAPI library.

SQLGlobalsMBS.GetVersionMinor as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SQL MBS SQL Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The minor version number of the SQLAPI library.

SQLGlobalsMBS.PutEnv(line as string) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SQL MBS SQL Plugin 13.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets environment variable.

Line format should be "key=value" and returns true on success and false on failure.

SQLGlobalsMBS.RaiseException(message as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SQL MBS SQL Plugin 13.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Raises an exception to test exception handling in SQL Plugin.

Raises directly a SQLErrorExceptionMBS with the given message.

SQLGlobalsMBS.RaiseSQLErrorException(UserCode as Integer, message as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SQL MBS SQL Plugin 13.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Raises an exception to test exception handling in SQL Plugin.

Raises a SAUserException which the plugin catches and translates to a SQLErrorExceptionMBS in Xojo.

Some examples using this method:

SQLGlobalsMBS.SetCurrentWorkingDirectory(path as folderitem) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SQL MBS SQL Plugin 16.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the current working directory.

This is often useful to make sure the DLLs in that folder are found.

See also:

SQLGlobalsMBS.SetCurrentWorkingDirectory(path as String) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SQL MBS SQL Plugin 16.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the current working directory.

This is often useful to make sure the DLLs in that folder are found.

See also:

SQLGlobalsMBS.SetDllDirectory(path as folderitem) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SQL MBS SQL Plugin 25.1 ❌ No ✅ Yes ❌ No ❌ No All
Adds a directory to the search path used to locate DLLs for the application.

The directory to be added to the search path. If this parameter is an empty string (""), the call removes the current directory from the default DLL search order. If this parameter is nil, the function restores the default search order.

If the function succeeds, the return value is true, otherwise false.

The SetDllDirectory function affects all subsequent calls to the LoadLibrary and LoadLibraryEx functions. It also effectively disables safe DLL search mode while the specified directory is in the search path.

After calling SetDllDirectory, the standard DLL search path is

  • The directory from which the application loaded.
  • The directory specified by the SetDllDirectory function.
  • The system directory. Use the GetSystemDirectory function to get the path of this directory. The name of this directory is System32.
  • The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
  • The directories that are listed in the PATH environment variable.
Each time the SetDllDirectory function is called, it replaces the directory specified in the previous SetDllDirectory call.

To revert to the standard search path used by LoadLibrary and LoadLibraryEx, call SetDllDirectory with nil. This also restores safe DLL search mode based on the SafeDllSearchMode registry value.

See also:

SQLGlobalsMBS.SetDllDirectory(path as String) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SQL MBS SQL Plugin 25.1 ❌ No ✅ Yes ❌ No ❌ No All
Adds a directory to the search path used to locate DLLs for the application.
Example
call SQLGlobalsMBS.SetDllDirectory("C:\Program Files\MySQL\MySQL Server 5.7\lib")

The directory to be added to the search path. If this parameter is an empty string (""), the call removes the current directory from the default DLL search order. If this parameter is nil, the function restores the default search order.

If the function succeeds, the return value is true, otherwise false.

The SetDllDirectory function affects all subsequent calls to the LoadLibrary and LoadLibraryEx functions. It also effectively disables safe DLL search mode while the specified directory is in the search path.

After calling SetDllDirectory, the standard DLL search path is

  • The directory from which the application loaded.
  • The directory specified by the SetDllDirectory function.
  • The system directory. Use the GetSystemDirectory function to get the path of this directory. The name of this directory is System32.
  • The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
  • The directories that are listed in the PATH environment variable.
Each time the SetDllDirectory function is called, it replaces the directory specified in the previous SetDllDirectory call.

To revert to the standard search path used by LoadLibrary and LoadLibraryEx, call SetDllDirectory with nil. This also restores safe DLL search mode based on the SafeDllSearchMode registry value.

See also:

SQLGlobalsMBS.SetEnv(name as string, value as string) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SQL MBS SQL Plugin 13.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets an environment variable.

Existing variable with same name will be overwritten.
Returns true on success and false on failure.

SQLGlobalsMBS.SetLicenseCode(n as string, enddate as Integer, v1 as Integer, v2 as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SQL MBS SQL Plugin 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Registeres the SQL plugin and library.

Once you ordered a license, you receive details on how to call this method.

SQLGlobalsMBS.Setlocale(category as Integer, locale as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SQL MBS SQL Plugin 10.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the locale to use.
Example
// ask for English for USA with 1252 codepage
SQLGlobalsMBS.Setlocale SQLGlobalsMBS.LocaleAll, "English_United States.1252"

The Setlocale function sets the C library's notion of natural language formatting style for particular sets of routines. Each such style is called a 'locale' and is invoked using an appropriate name passed as a C string.

The setlocale() function recognizes several categories of routines. These are the categories and the sets of routines they select:

LocaleAllSet the entire locale generically.
LocaleCollateSet a locale for string collation routines. This controls alphabetic ordering in strcoll() and strxfrm().
LocaleCTypeSet a locale for the ctype and multibyte functions. This controls recognition of upper and lower case, alphabetic or non-alphabetic characters, and so on.
LocaleMessagesSet a locale for message catalogs, see catopen function.
LocaleMonetarySet a locale for formatting monetary values; this affects the localeconv() function.
LocaleNumericSet a locale for formatting numbers. This controls the formatting of decimal points in input and output of floating point numbers in functions such as printf() and scanf(), as well as values returned by localeconv().
LocaleTimeSet a locale for formatting dates and times using the strftime() function.

Only three locales are defined by default: the empty string "" (which denotes the native environment) and the "C" and "POSIX" locales (which denote the C-language environment). By default, C programs start in the "C" locale.

SQLGlobalsMBS.UnInitialize

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SQL MBS SQL Plugin 21.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Explicitly shutdown SQL engine.

You can call this in App Close or Destructor, but only after you destroyed all Connections, e.g. all SQLDatabaseMBS and SQLConnectionMBS objects.

SQLGlobalsMBS.UnSetEnv(name as string) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SQL MBS SQL Plugin 13.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Removes environment variable.

Returns true on success and false on failure.

Some examples using this method:

The items on this page are in the following plugins: MBS SQL Plugin.


The biggest plugin in space...