diff --git a/.gitignore b/.gitignore
index a7aa311..6b3b00c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
/DbmsConnectionWizard.accdb
+Working Data
diff --git a/README.md b/README.md
index 7682165..6c06c3b 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@ Configure DBMS connection + import DBMS connection framework
Video: https://access-codelib.net/videos/ACLib-DbmsConnection-Wizard/DbmsConnectionWizard-Use-Login-Form.mp4
## Install
-Download [DbmsConnectionWizard.accda](https://github.com/AccessCodeLib/DbmsConnectionWizard/blob/master/access-add-in/DbmsConnectionWizard.accda) and install the wizard with the Access Add-In Manager.
+Download [DbmsConnectionWizard.accda](https://github.com/AccessCodeLib/DbmsConnectionWizard/blob/master/access-add-in/DbmsConnectionWizard.accda) and the wizard with the Access Add-In Manager.
Note:
Use install.vbs to create a compiled version.
diff --git a/access-add-in/DbmsConnectionWizard.accda b/access-add-in/DbmsConnectionWizard.accda
index 03df597..f29cb3f 100644
Binary files a/access-add-in/DbmsConnectionWizard.accda and b/access-add-in/DbmsConnectionWizard.accda differ
diff --git a/doc/.nd_config/Comments.txt b/doc/.nd_config/Comments.txt
new file mode 100644
index 0000000..9680c05
--- /dev/null
+++ b/doc/.nd_config/Comments.txt
@@ -0,0 +1,83 @@
+Format: 2.2
+
+# This is the Natural Docs comments file for this project. If you change
+# anything here, it will apply to THIS PROJECT ONLY. You can edit the version
+# in Natural Docs' Config folder to make the changes apply to all projects,
+# but it's recommended that you edit this version instead.
+
+
+# Ignored Keywords
+# ------------------------------------------------------------------------
+
+# If you'd like to prevent keywords from being recognized by Natural Docs,
+# you can do it like this:
+#
+# Ignore Keywords:
+# [keyword]
+# [keyword]
+# ...
+
+
+# Comment Types
+# ------------------------------------------------------------------------
+
+# Each Natural Docs comment has a corresponding type which determine its
+# behavior. You can define your own here or override the settings of the
+# existing ones.
+#
+# Comment Type: [name]
+# Alter Comment Type: [name]
+# Creates a new comment type or changes an existing one.
+#
+# Display Name: [name]
+# Plural Display Name: [name]
+# The singular and plural name of the comment type as it should appear in
+# the output.
+#
+# Simple Identifier: [name]
+# The name of the comment type using only the letters A to Z. No spaces,
+# numbers, symbols, or Unicode allowed. Defaults to the comment type name
+# minus any unacceptable characters. This is used to generate things like
+# CSS class names.
+#
+# Scope: [normal|start|end|always global]
+# How the comment affects scope. Defaults to normal.
+# normal - The comment stays within the current scope.
+# start - The comment starts a new scope for all the comments
+# beneath it, like class comments.
+# end - The comment resets the scope back to global for all the
+# comments beneath it, like section comments.
+# always global - The comment is defined as a global symbol, but does not
+# change the scope for any other comments.
+#
+# Flags: [flag], [flag], ...
+# A combination of settings that apply to the comment type.
+# Code, File, or Documentation
+# Whether it's used to describe a code element, a file, or is a
+# standalone documentation comment. Defaults to Code.
+# Variable Type
+# Whether it describes a code element that can be used as a variable's
+# type.
+# Class Hierarchy or Database Hierarchy
+# Whether it describes a code element that should be included in the
+# class or database hierarchy. Requires Scope: Start.
+# Enum
+# Whether it describes an enum.
+#
+# Keywords:
+# [keyword]
+# [keyword], [plural keyword]
+# ...
+# A list of the comment type's keywords. Each line after the heading is
+# the keyword and optionally its plural form for list comments. You can
+# reuse existing keywords to change their definition. When using
+# "Alter Comment Type", these keywords are added to the existing ones
+# rather than replacing them.
+#
+# [Language] Keywords:
+# [keyword]
+# [keyword], [plural keyword]
+# ...
+# A list of keywords that only apply to the comment type when using a
+# specific programming language. Each line after the heading is the
+# keyword and optionally its plural form for list comments.
diff --git a/doc/.nd_config/Languages.txt b/doc/.nd_config/Languages.txt
new file mode 100644
index 0000000..648240d
--- /dev/null
+++ b/doc/.nd_config/Languages.txt
@@ -0,0 +1,95 @@
+Format: 2.2
+
+# This is the Natural Docs languages file for this project. If you change
+# anything here, it will apply to THIS PROJECT ONLY. You can edit the version
+# in Natural Docs' Config folder to make the changes apply to all projects,
+# but it's recommended that you edit this version instead.
+
+
+# Ignored Extensions
+# ------------------------------------------------------------------------
+
+# If you'd like to prevent certain file extensions from being scanned by
+# Natural Docs, you can do it like this:
+#
+# Ignore Extensions: [extension] [extension] ...
+
+
+# Languages
+# ------------------------------------------------------------------------
+
+# These settings define the languages Natural Docs knows how to parse. You
+# can define your own here or override the settings of the existing ones.
+# Note that all lists are space separated so that commas can be used as
+# values.
+#
+# Language: [name]
+# Alter Language: [name]
+# Defines a new language or alters an existing one. Its name can use any
+# characters. If any of the properties below have an add/replace form, you
+# must use that when using Alter Language.
+#
+# The language Shebang Script is special. It's entry is only used for
+# extensions, and files with those extensions have their shebang (#!) lines
+# read to determine the real language of the file. Extensionless files are
+# always treated this way.
+#
+# The language Text File is also special. It's treated as one big comment
+# so you can put Natural Docs content in them without special symbols.
+#
+# Extensions: [extension] [extension] ...
+# [Add/Replace] Extensions: [extension] [extension] ...
+# Defines the file extensions of the language's source files.
+#
+# Shebang Strings: [string] [string] ...
+# [Add/Replace] Shebang Strings: [string] [string] ...
+# Defines a list of strings that can appear in the shebang (#!) line to
+# designate that it's part of the language.
+#
+# Simple Identifier: [name]
+# The name of the language using only the letters A to Z. No spaces,
+# numbers, symbols, or Unicode allowed. Defaults to the language name
+# minus any unacceptable characters. This is used to generate things like
+# CSS class names.
+#
+# Aliases: [alias] [alias] ...
+# [Add/Replace] Aliases: [alias] [alias] ...
+# Defines alternative names for the language that can be used to start a
+# code block.
+#
+#
+# Properties for Basic Language Support Only
+# ------------------------------------------------------------------------
+# If you're adding your own language to Natural Docs you must define these.
+#
+# Line Comments: [symbol] [symbol] ...
+# Defines a space-separated list of symbols that are used for line comments,
+# if any.
+#
+# Block Comments: [opening sym] [closing sym] [opening sym] [closing sym] ...
+# Defines a space-separated list of symbol pairs that are used for block
+# comments, if any.
+#
+# Member Operator: [symbol]
+# Defines the default member operator symbol. The default is a dot.
+#
+# Line Extender: [symbol]
+# Defines the symbol that allows a prototype to span multiple lines if
+# normally a line break would end it.
+#
+# Enum Values: [global|under type|under parent]
+# Defines how enum values are referenced. The default is global.
+# global - Values are always global, referenced as 'value'.
+# under type - Values are under the enum type, referenced as
+# 'class.enum.value'.
+# under parent - Values are under the enum's parent, referenced as
+# 'class.value'.
+#
+# Case Sensitive: [yes|no]
+# Defines whether the language's identifiers are case sensitive. The
+# default is yes.
+#
+# [Comment Type] Prototype Enders: [symbol] [symbol] ...
+# When defined, Natural Docs will attempt to get a prototype from the code
+# immediately following the comment type. It stops when it reaches one of
+# these symbols. Use \n for line breaks.
diff --git a/doc/.nd_config/Project.txt b/doc/.nd_config/Project.txt
new file mode 100644
index 0000000..e9b1a91
--- /dev/null
+++ b/doc/.nd_config/Project.txt
@@ -0,0 +1,209 @@
+Format: 2.2
+
+# This is the main file you use to configure Natural Docs for your project.
+
+
+# Project Information
+# ------------------------------------------------------------------------
+
+Title: ACLib Database Connection Framework
+
+Timestamp: Last updated yyyy-mm-dd
+# m - Single digit month, when possible. January is "1".
+# mm - Always double digit month. January is "01".
+# mon - Short month word. January is "Jan".
+# month - Long month word. January is "January".
+# d - Single digit day, when possible. 1 is "1".
+# dd - Always double digit day. 1 is "01".
+# day - Day with text extension. 1 is "1st".
+# yy - Double digit year. 2022 is "22".
+# yyyy - Four digit year. 2022 is "2022".
+# year - Four digit year. 2022 is "2022".
+
+Style: style
+
+Encoding: iso-8859-1
+
+
+# This is where you put general information about your project. None of these
+# settings are required, though Title is recommended.
+#
+# Title: [text]
+# The name of your project. (R) and (TM) will be converted to their
+# respective symbols.
+#
+# Subtitle: [text]
+# A subtitle for your project, if desired.
+#
+# Copyright: [text]
+# The copyright notice for your project. (C) will be converted to the
+# copyright symbol.
+#
+# Timestamp: [text]
+# Text explaining when the documentation was generated, such as "Last
+# Updated Month Day Year", if you want that to be included. The following
+# substitutions are performed:
+#
+# m - Single digit month, when possible. January is "1".
+# mm - Always double digit month. January is "01".
+# mon - Short month word. January is "Jan".
+# month - Long month word. January is "January".
+# d - Single digit day, when possible. 1 is "1".
+# dd - Always double digit day. 1 is "01".
+# day - Day with text extension. 1 is "1st".
+# yy - Double digit year. 2022 is "22".
+# yyyy - Four digit year. 2022 is "2022".
+# year - Four digit year. 2022 is "2022".
+#
+# Style: [style]
+# A custom style to apply to the generated documentation. See
+# https://naturaldocs.org/reference/styles for more information.
+#
+# Home Page: [file]
+# A custom home page for the generated documentation. It could be a
+# documented file in one of the source folders or a HTML file in any
+# location.
+#
+# Encoding: [name or code page number]
+# Encoding: [name or code page number] *.[extension]
+# The character encoding source files use if it is something other than
+# Unicode. It can be specified as a name such as "iso-8859-1" or a code
+# page number such as "28591". You can see the list of encodings your
+# system supports by running Natural Docs with the --list-encodings command
+# line option.
+#
+# Natural Docs defaults to Unicode which will handle all forms of UTF-8,
+# UTF-16, and UTF-32. You can set a new default for all files or you can
+# limit it to an extension such as "*.txt". You can use multiple Encoding
+# lines to cover all the extensions that need them.
+#
+# You can also set encodings for specific folders by adding Encoding lines
+# in Source Folder sections.
+
+
+# Source Code
+# ------------------------------------------------------------------------
+
+Source Folder: ..\..\source\codelib\data
+
+
+# This is where you tell Natural Docs which folders it should scan for source
+# files. If you add any on the command line this section is ignored except
+# for the properties of the ones from the command line.
+#
+# Source Folder: [folder]
+# Specifies a folder which will be searched for source files. The path is
+# relative to the project configuration folder, which lets this file remain
+# portable across computers and not cause problems in version control
+# systems. You can enter an absolute path and it will be converted
+# automatically.
+#
+# Additional properties can be added after each source folder:
+#
+# Name: [name]
+# How this source folder will appear in the menu if you have more than
+# one.
+#
+# Encoding: [name or code page number]
+# Encoding: [name or code page number] *.[extension]
+# Encoding: [name or code page number] [folder]
+# Encoding: [name or code page number] [folder]\*.[extension]
+# The character encoding source files use if it's something other than
+# Unicode. It can be specified as a name such as "iso-8859-1" or a code
+# page number such as "28591". You can see the list of encodings your
+# system supports by running Natural Docs with the --list-encodings
+# command line option.
+#
+# Natural Docs defaults to Unicode which will handle all forms of UTF-8,
+# UTF-16, and UTF-32. You can set a new default for all files in this
+# folder, limit it to an extension such as "*.txt", limit it to a
+# subfolder, or limit it to extensions in a subfolder. You can use
+# multiple Encoding lines to cover all the subfolders and extensions
+# that need them.
+
+
+# Source Filtering
+# ------------------------------------------------------------------------
+
+# If there are any subfolders in the source code that you would like Natural
+# Docs to ignore they can be added here. If you use any of these options on
+# the command line this section is ignored.
+#
+# Ignore Source Folder: [folder]
+# Tells Natural Docs to skip this folder when scanning files.
+#
+# Ignore Source Folder Pattern: [pattern]
+# Tells Natural Docs to skip all folder names which match this pattern when
+# scanning files. ? matches a single character, * matches zero or more
+# characters. It applies to the entire folder name, so "cli" will not
+# match "client", although "cli*" will.
+#
+# The data folders of common version control systems (.git, .svn, .cvs, .hg)
+# are ignored automatically. You don't have to add them here.
+
+
+# Images
+# ------------------------------------------------------------------------
+
+# This is where you tell Natural Docs which folders it should look for images
+# in. When you put something like (see diagram.jpg) in a comment Natural Docs
+# will look for it relative to the source file it appears in plus any folders
+# added here. If you add any on the command line this section is ignored.
+#
+# Image Folder: [folder]
+# Specifies a folder which will be searched for image files. The path is
+# relative to the project configuration folder, which lets this file remain
+# portable across computers and not cause problems in version control
+# systems. You can enter absolute paths and they will be converted
+# automatically.
+
+
+
+# Generated Documentation
+# ------------------------------------------------------------------------
+
+HTML Output Folder: ..\ACLib-DbConnection-Framework
+
+
+# This is where you tell Natural Docs what kind of documentation you want
+# built and where it should be put. If you use any of these options on the
+# command line this section is ignored except for the properties of the ones
+# from the command line.
+#
+# HTML Output Folder: [folder]
+# Generates HTML documentation in the specified folder. The path is
+# relative to the project configuration folder, which lets this file remain
+# portable across computers and not cause problems in version control
+# systems. You can enter an absolute path and it will be converted
+# automatically.
+#
+# Additional properties can be added after each output folder:
+#
+# Title: [text]
+# Subtitle: [text]
+# Copyright: [text]
+# Timestamp: [text]
+# Style: [style]
+# Home Page: [file]
+# These properties can be overridden for just this output folder, which
+# allows you to have multiple output folders with different styles or
+# titles. See the Project Information section for descriptions of them.
+
+
+# Global Settings
+# ------------------------------------------------------------------------
+
+# Other settings that apply to your entire project. Settings specified on the
+# command line override the settings here.
+#
+# Tab Width: [width]
+# The number of spaces tabs should be expanded to.
+#
+# Documented Only: [yes|no]
+# Whether only documented code elements should appear in the output.
+# Defaults to no.
+#
+# Auto Group: [yes|no]
+# Whether groups should automatically apply to you code. Defaults to yes.
+
+
diff --git a/doc/.nd_config/style/Style.txt b/doc/.nd_config/style/Style.txt
new file mode 100644
index 0000000..dfa06e1
--- /dev/null
+++ b/doc/.nd_config/style/Style.txt
@@ -0,0 +1,92 @@
+Format: 2.2
+
+# This is a configuration file for a Natural Docs HTML output style.
+
+
+# Inheritance
+# ------------------------------------------------------------------------
+
+Inherit: Default
+
+
+# You can inherit the settings of another style like this:
+#
+# Inherit: [style]
+#
+# All of its settings will be applied before yours. You can add this line
+# multiple times to inherit more than one style.
+#
+# If you just want to make some changes to the default style, inherit Default.
+# If you're building your own page design from scratch but want to keep the
+# default JavaScript functions, inherit DefaultJS. This will include the code
+# but not the CSS or images.
+
+
+# Linked Files
+# ------------------------------------------------------------------------
+
+# You can link .css, .js, and .json files to the output like this:
+#
+# Link: [file]
+# Frame Link: [file]
+# Content Link: [file]
+# Home Link: [file]
+#
+# These files will be added to the generated output via link or script tags.
+#
+# You can limit JavaScript files to just to the frame page, which handles the
+# header, footer, menu, summary, and search, or to content pages, which is the
+# documentation in the rightmost panel, or to the home page. If you do not
+# specify a page type they will be linked to every page. CSS files can only
+# be linked to every page.
+#
+# All files will be copied to the output folder even if you don't link them,
+# but they will not be added to the pages automatically.
+
+
+# OnLoad
+# ------------------------------------------------------------------------
+
+# You can add code to the page's OnLoad handler like this:
+#
+# OnLoad: [statement]
+# Frame OnLoad: [statement]
+# Content OnLoad: [statement]
+# Home OnLoad: [statement]
+#
+# You can limit it to just to the frame page, which handles the header,
+# footer, menu, summary, and search, or to content pages, which is the
+# documentation in the rightmost panel, or to the home page. If you do not
+# specify a page type it will be added to every page.
+#
+# The OnLoad statement is limited to a single line. If you have a lot of code
+# it's recommended that you make it a function in a separate .js file, link
+# that file, and then call the function from this statement rather than trying
+# to cram it all on this line.
+
+
+# Home Page
+# ------------------------------------------------------------------------
+
+# You can choose a custom HTML file to serve as the home page for the output
+# like this:
+#
+# Home Page: [file]
+#
+# It will appear in the content area of the documentation's home page,
+# separate from the header and side menu which will both still be visible.
+# The file you choose must have a .html extension.
+#
+# If this is defined, none of the OnLoad or Link properties will have any
+# effect on it. You must add those things directly to the HTML file if
+# they're needed.
+#
+# The HTML file may contain these strings which will be replaced by your
+# project information. They will have entity substitutions made for <, >, &,
+# and " characters so they're safe to place directly in the HTML or inside
+# double-quoted JavaScript strings.
+#
+# %NaturalDocs_Title%
+# %NaturalDocs_Subtitle%
+# %NaturalDocs_Copyright%
+# %NaturalDocs_Timestamp%
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionHandler-Summary.js b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionHandler-Summary.js
new file mode 100644
index 0000000..8d40efb
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionHandler-Summary.js
@@ -0,0 +1 @@
+NDFramePage.OnPageTitleLoaded("VisualBasicClass:data.DbConnectionHandler","DbConnectionHandler");NDSummary.OnSummaryLoaded("VisualBasicClass:data.DbConnectionHandler",[["Visual Basic","VisualBasic"]],[["Classes","Class"],["Events","Event"],["Functions","Function"],["Groups","Group"],["Properties","Property"]],[[184,0,0,"data.DbConnectionHandler"],[185,0,3,"Events","Events"],[186,0,1,"ErrorMissingCurrentDb","ErrorMissingCurrentDb"],[187,0,1,"ErrorMissingCurrentConnection","ErrorMissingCurrentConnection"],[188,0,1,"ErrorEmptyOledbConnectionString","ErrorEmptyOledbConnectionString"],[189,0,1,"ErrorEmptyOdbcConnectionString","ErrorEmptyOdbcConnectionString"],[190,0,1,"Disposed","Disposed"],[191,0,3,"Dispose support","Dispose_support"],[192,0,2,"Dispose","Dispose"],[193,0,3,"DAO data connection","DAO_data_connection"],[194,0,4,"DAO","DAO"],[195,0,4,"CurrentDb","CurrentDb"],[196,0,3,"ADODB data connection","ADODB_data_connection"],[197,0,4,"ADODB","ADODB"],[198,0,4,"CurrentConnection","CurrentConnection"],[199,0,4,"OledbConnectionString","OledbConnectionString"],[200,0,3,"ODBC data connection","ODBC_data_connection"],[201,0,4,"ODBC","ODBC"],[202,0,4,"OdbcConnectionString","OdbcConnectionString"],[203,0,4,"CurrentDbBE","CurrentDbBE"]]);
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionHandler-SummaryToolTips.js b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionHandler-SummaryToolTips.js
new file mode 100644
index 0000000..29a8440
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionHandler-SummaryToolTips.js
@@ -0,0 +1 @@
+NDSummary.OnToolTipsLoaded("VisualBasicClass:data.DbConnectionHandler",{184:"
Database connection via ADODB or DAO (incl. ODBC)
",185:"
Error events for possible error handling via the frontend application
",186:"
Event for missing CurrentDb reference (Passing the data.dao.DaoHandler or data.odbc.OdbcHandler event: ErrorMissingCurrentDb)
",187:"
Event for missing ADODB connection reference (Passing the AdodbHandler event: data.adodb.AdodbHandler::ErrorMissingCurrentConnection)
",188:"
Event for missing OLEDB connection string (Passing the AdodbHandler event: data.adodb.AdodbHandler::ErrorEmptyOledbConnectionString )
",189:"
Event for missing ODBC connection string (Passing the OdbcHandler event: data.odbc.OdbcHandler::ErrorEmptyConnectionString)
",190:"
Event message when object references have been removed
",192:"
Public Sub Dispose()
Remove object references
",193:"
DAO access methods
",194:"
Instance of data.dao.DaoHandler
",195:"
CurrentDb = data.dao.DaoHandler::CurrentDb
",196:"
ADODB access methods
",197:"
Instance of data.adodb.AdodbHandler
",198:"
ADODB connection to the current DBMS connection = data.adodb.AdodbHandler::CurrentConnection
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionHandler-ToolTips.js b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionHandler-ToolTips.js
new file mode 100644
index 0000000..a977435
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionHandler-ToolTips.js
@@ -0,0 +1 @@
+NDContentPage.OnToolTipsLoaded({19:"
ADODB data connection methods
",21:"
Event for missing ADODB connection reference (Passing the AdodbHandler event: data.adodb.AdodbHandler::ErrorMissingCurrentConnection)
",22:"
Event for missing OLEDB connection string
",27:"
Currently set ADODB connection
",28:"
OLEDB connection string
",45:"
ODBC data connection methods
",48:"
Event for missing ODBC connection string
",56:"
Database-Referenz zum Backend
",57:"
ODBC Connection string
",80:"
DAO data connection methods
",87:"
CurrentDbC variant
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionHandler.html b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionHandler.html
new file mode 100644
index 0000000..42dadfb
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionHandler.html
@@ -0,0 +1,111 @@
+
+
+DbConnectionHandler
+
+
+
+
+
+
+
+
+
data.DbConnectionHandler
+
Database connection via ADODB or DAO (incl. ODBC)
Standardises ADO and DAO methods
Author
Josef Poetzl
+
+
+
+
Events
+
Error events for possible error handling via the frontend application
+
+
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionInfo-Summary.js b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionInfo-Summary.js
new file mode 100644
index 0000000..5d743eb
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionInfo-Summary.js
@@ -0,0 +1 @@
+NDFramePage.OnPageTitleLoaded("VisualBasicClass:data.DbConnectionInfo","DbConnectionInfo");NDSummary.OnSummaryLoaded("VisualBasicClass:data.DbConnectionInfo",[["Visual Basic","VisualBasic"]],[["Classes","Class"],["Events","Event"],["Functions","Function"],["Groups","Group"],["Properties","Property"]],[[150,0,0,"data.DbConnectionInfo"],[151,0,3,"Events","Events"],[152,0,1,"DbmsConnectionChanged","DbmsConnectionChanged"],[153,0,1,"DbmsConnectionInfoCleared","DbmsConnectionInfoCleared"],[154,0,1,"DbmsInfoMessage","DbmsInfoMessage"],[155,0,1,"PasswordChanged","PasswordChanged"],[156,0,1,"Disposed","Disposed"],[157,0,3,"DBMS Connection Parameters","DBMS_Connection_Parameters"],[158,0,4,"ConnectionIdentifier","ConnectionIdentifier"],[159,0,4,"DbmsName","DbmsName"],[160,0,4,"DbServer","DbServer"],[161,0,4,"DbName","DbName"],[162,0,4,"DatabaseFile","DatabaseFile"],[163,0,4,"UseLoginForm","UseLoginForm"],[164,0,4,"LoginForm","LoginForm"],[165,0,4,"DbUser","DbUser"],[166,0,4,"DbUserPassword","DbUserPassword"],[167,0,4,"SavePassword","SavePassword"],[168,0,3,"DBMS Connection","DBMS_Connection"],[169,0,4,"ConnectionStrings","ConnectionStrings"],[170,0,4,"OledbConnectionString","OledbConnectionString"],[171,0,4,"OdbcConnectionString","OdbcConnectionString"],[172,0,2,"CheckConnection","CheckConnection"],[173,0,2,"ClearConnectionInfo","ClearConnectionInfo"],[174,0,2,"ChangeDbUserPassword","ChangeDbUserPassword"],[175,0,3,"DMBS specific","DMBS_specific"],[176,0,4,"PermanentBackendRstSqlText","PermanentBackendRstSqlText"],[177,0,4,"TableListSqlText","TableListSqlText"],[178,0,2,"ParseTableName","ParseTableName"],[179,0,4,"DateFormat","DateFormat"],[180,0,4,"WildCardString","WildCardString"],[181,0,4,"BooleanTrueString","BooleanTrueString"],[182,0,4,"LoginFormName","LoginFormName"],[183,0,4,"DbmsConfigFormName","DbmsConfigFormName"]]);
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionInfo-SummaryToolTips.js b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionInfo-SummaryToolTips.js
new file mode 100644
index 0000000..9b473a3
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionInfo-SummaryToolTips.js
@@ -0,0 +1 @@
+NDSummary.OnToolTipsLoaded("VisualBasicClass:data.DbConnectionInfo",{150:"
Auxiliary class for setting the connection parameters
",152:"
Event when the connection changes
",153:"
Event raised when the connection parameters have been reset
",154:"
Information sharing event
",155:"
Event raised when the password has been changed
",156:"
Event raised when disposed
",159:"
Name of DBMS (MSJET, MSSQL, MySQL, ORACLE, ODBC)
",160:"
Name of Database Server
",161:"
Name of Database
",162:"
File name incl. path of a file-based backend
",163:"
Setting from the connection parameters whether to use the login form when logging in.
",164:"
Form reference to LoginForm
",165:"
Name des Datenbankbenutzers
",166:"
Password of the database user
",167:"
Setting from the connection parameters whether password should be saved for linked tables
",169:"
ODBC and OLEDB Connectionstring
",170:"
OledbConnectionString
",171:"
OdbcConnectionString
",172:"
Public Function CheckConnection(
Optional ByRef ErrMsg
As
String
=
vbNullString
) As Boolean
Check connection to server and database
",173:"
Public Sub ClearConnectionInfo()
Delete set connection parameters
",174:"
Public Function ChangeDbUserPassword(
ByVal NewPassword
As
String,
ByVal OldPassword
As
String,
Optional ByVal LoginName
As
String
=
vbNullString,
Optional ByRef Msg
As
String
) As Boolean
Datenbankpasswort des Benutzers ändern
",176:"
Select statement for ODBC recordset connection to maintain connection
",177:"
SQL-Anweisung im SQL-Dialtekt des DBMS zur Auflistung der im DBS enthaltenen Tabellen
",178:"
Public Function ParseTableName(
ByVal TableName
As
String
) As String
Auxiliary procedure for adjusting the table name
",179:"
DBMS specific date format
",180:"
DBMS specific wildcard (like *)
",181:"
DBMS specific string for true
",182:"
Name of the login form
",183:"
Name of the DBMS configuration form
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionInfo-ToolTips.js b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionInfo-ToolTips.js
new file mode 100644
index 0000000..e4d5c38
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionInfo-ToolTips.js
@@ -0,0 +1 @@
+NDContentPage.OnToolTipsLoaded({127:"
Type for the simultaneous transfer of the connection strings
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionInfo.html b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionInfo.html
new file mode 100644
index 0000000..ba8be55
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionInfo.html
@@ -0,0 +1,181 @@
+
+
+DbConnectionInfo
+
+
+
+
+
+
+
+
+
data.DbConnectionInfo
+
Auxiliary class for setting the connection parameters
Author
Josef Poetzl
Remarks
Uses table usys_DbmsConnection (create table with DBMS Connection Wizard)
+
+
+
+
Events
+
+
+
+
DbmsConnectionChanged
+
Event when the connection changes
Parameters
NewConnectionIdentifier
new used connection identifier (from table data field CID)
Remarks
Can be useful if displays are updated depending on the connection, etc.
+
+
+
+
DbmsConnectionInfoCleared
+
Event raised when the connection parameters have been reset
+
+
+
+
DbmsInfoMessage
+
Information sharing event
Parameters
Source
Source of the message
Msg
Message
MsgStyle
VbMsgBoxStyle
Remarks
Used to pass on info (similar to debug.print)
+
+
+
+
PasswordChanged
+
Event raised when the password has been changed
+
+
+
+
Disposed
+
Event raised when disposed
+
+
+
+
DBMS Connection Parameters
+
+
+
+
ConnectionIdentifier
+
Connection identifier
value from data field CID
+
+
+
+
DbmsName
+
Name of DBMS (MSJET, MSSQL, MySQL, ORACLE, ODBC)
+
+
+
+
DbServer
+
Name of Database Server
Remarks
Incl. instance of SQL Server & co.
+
+
+
+
DbName
+
Name of Database
+
+
+
+
DatabaseFile
+
File name incl. path of a file-based backend
+
+
+
+
UseLoginForm
+
Setting from the connection parameters whether to use the login form when logging in.
+
+
+
+
LoginForm
+
Form reference to LoginForm
+
+
+
+
DbUser
+
Name des Datenbankbenutzers
Parameters
WithoutServerCheck
True = Do not check whether connection data has already been read in.
+
+
+
+
DbUserPassword
+
Password of the database user
Remarks
The password should normally never need to be requested and should only be used for sharing within the class structure.
+
+
+
+
SavePassword
+
Setting from the connection parameters whether password should be saved for linked tables
This procedure must be extended if other DBMSs (such as Oracle) are to be used.
+
+
+
+
OledbConnectionString
+
OledbConnectionString
Returns
String
+
+
+
+
OdbcConnectionString
+
OdbcConnectionString
Parameters
WithoutUserInfo
False = user ID incl. password is contained in the ODBC connection string, True = without user data
Returns
String
Remarks
Setting the parameter WithoutUserInfo is normally not necessary, but can be helpful if the ODBC connection string is required without a password.
+
+
+
+
CheckConnection
+
Public Function CheckConnection(
Optional ByRef ErrMsg
As
String
=
vbNullString
) As Boolean
+
Check connection to server and database
Parameters
ErrMsg
Error message from ADODB or ODBC connection
Returns
Boolean
True = Ado- and ODBC-connection could be established
Remarks
The first test is to establish the ADO connection. As soon as this is successful, the ODBC connection is tested.
+
+
+
+
ClearConnectionInfo
+
Public Sub ClearConnectionInfo()
+
Delete set connection parameters
Remarks
Requires re-reading from table when connection data is requested.
+
+
+
+
ChangeDbUserPassword
+
Public Function ChangeDbUserPassword(
ByVal NewPassword
As
String,
ByVal OldPassword
As
String,
Optional ByVal LoginName
As
String
=
vbNullString,
Optional ByRef Msg
As
String
) As Boolean
+
Datenbankpasswort des Benutzers ändern
Parameters
NewPassword
New passwort
OldPassword
old passwort
LoginName
Login name (If no login name is passed, the current login name is used).
Msg
ByRef parameter to return an error message if the password could not be changed
Returns
Boolean
True = Password has been changed
+
+
+
+
DMBS specific
+
+
+
+
PermanentBackendRstSqlText
+
Select statement for ODBC recordset connection to maintain connection
Remarks
This procedure must be extended if other DBMSs (such as Oracle) are to be used.
+
+
+
+
TableListSqlText
+
SQL-Anweisung im SQL-Dialtekt des DBMS zur Auflistung der im DBS enthaltenen Tabellen
Remarks
This procedure must be extended if further DBMS are to be used.
+
+
+
+
ParseTableName
+
Public Function ParseTableName(
ByVal TableName
As
String
) As String
+
Auxiliary procedure for adjusting the table name
Parameters
TableName
Table name to parse
Returns
Table name for the specific DBMS
Remarks
With some DBMS, the name must be case-sensitive or bracketed with special characters.
+
+
+
+
DateFormat
+
DBMS specific date format
Returns
Format string
+
+
+
+
WildCardString
+
DBMS specific wildcard (like *)
+
+
+
+
BooleanTrueString
+
DBMS specific string for true
+
+
+
+
LoginFormName
+
Name of the login form
Remarks
Example from ACLib: user/login/LoginForm.frm
+
+
+
+
DbmsConfigFormName
+
Name of the DBMS configuration form
+
+
+
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionManager-Summary.js b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionManager-Summary.js
new file mode 100644
index 0000000..22aacc8
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionManager-Summary.js
@@ -0,0 +1 @@
+NDFramePage.OnPageTitleLoaded("VisualBasicClass:data.DbConnectionManager","DbConnectionManager");NDSummary.OnSummaryLoaded("VisualBasicClass:data.DbConnectionManager",[["Visual Basic","VisualBasic"]],[["Classes","Class"],["Functions","Function"],["Groups","Group"],["Properties","Property"]],[[142,0,0,"data.DbConnectionManager"],[143,0,2,"Functions","Functions"],[144,0,1,"Dispose","Dispose"],[145,0,1,"CheckConnectionStatus","CheckConnectionStatus"],[146,0,2,"Properties","Properties"],[147,0,3,"DefaultSettings","DefaultSettings"],[148,0,3,"ConnectionInfo","ConnectionInfo"],[149,0,3,"DbConnection","DbConnection"]]);
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionManager-SummaryToolTips.js b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionManager-SummaryToolTips.js
new file mode 100644
index 0000000..504a2e0
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionManager-SummaryToolTips.js
@@ -0,0 +1 @@
+NDSummary.OnToolTipsLoaded("VisualBasicClass:data.DbConnectionManager",{142:"
Class for instantiation, termination and basic control of data access classes
",144:"
Public Sub Dispose()
Remove object references
",145:"
Public Function CheckConnectionStatus() As Boolean
Test whether a connection can be established
",147:"
Test whether a connection can be established
",148:"
DbConnectionInfo instance
",149:"
DbConnectionHandler instance = Top level of the data access structure
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionManager-ToolTips.js b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionManager-ToolTips.js
new file mode 100644
index 0000000..e1934b3
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionManager-ToolTips.js
@@ -0,0 +1 @@
+NDContentPage.OnToolTipsLoaded({133:"
Auxiliary class for caching the connection parameters
",150:"
Auxiliary class for setting the connection parameters
",184:"
Database connection via ADODB or DAO (incl. ODBC)
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionManager.html b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionManager.html
new file mode 100644
index 0000000..309d129
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionManager.html
@@ -0,0 +1,51 @@
+
+
+DbConnectionManager
+
+
+
+
+
+
+
+
+
data.DbConnectionManager
+
Class for instantiation, termination and basic control of data access classes
Encapsulates ADODB and DAO methods as well as ODBC accesses
+
+
+
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionSettings-Summary.js b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionSettings-Summary.js
new file mode 100644
index 0000000..e26a481
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionSettings-Summary.js
@@ -0,0 +1 @@
+NDFramePage.OnPageTitleLoaded("VisualBasicClass:data.DbConnectionSettings","DbConnectionSettings");NDSummary.OnSummaryLoaded("VisualBasicClass:data.DbConnectionSettings",[["Visual Basic","VisualBasic"]],[["Classes","Class"],["Groups","Group"],["Properties","Property"]],[[133,0,0,"data.DbConnectionSettings"],[134,0,1,"Properties","Properties"],[135,0,2,"SqlDateFormat","SqlDateFormat"],[136,0,2,"SqlWildCardString","SqlWildCardString"],[137,0,2,"SqlBooleanTrueString","SqlBooleanTrueString"],[138,0,2,"DefaultAdodbCursorLocation","DefaultAdodbCursorLocation"],[139,0,2,"OpenPermanentBackendRecordset","OpenPermanentBackendRecordset"],[140,0,2,"Clone","Clone"],[141,0,2,"CopyFrom","CopyFrom"]]);
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionSettings-SummaryToolTips.js b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionSettings-SummaryToolTips.js
new file mode 100644
index 0000000..afe8c96
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionSettings-SummaryToolTips.js
@@ -0,0 +1 @@
+NDSummary.OnToolTipsLoaded("VisualBasicClass:data.DbConnectionSettings",{133:"
Auxiliary class for caching the connection parameters
",135:"
Date format string
",136:"
SQL wildcard
",137:"
SQL string for boolean true
",138:"
Default parameter value for ADODB.CursorLocationEnum
",139:"
Open permanent backend recordset if connected
",140:"
Clone of current config
",141:"
Copy DbConnectionSettings
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionSettings-ToolTips.js b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionSettings-ToolTips.js
new file mode 100644
index 0000000..eddcd48
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionSettings-ToolTips.js
@@ -0,0 +1 @@
+NDContentPage.OnToolTipsLoaded({});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionSettings.html b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionSettings.html
new file mode 100644
index 0000000..0ceaf25
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/DbConnectionSettings.html
@@ -0,0 +1,55 @@
+
+
+DbConnectionSettings
+
+
+
+
+
+
+
+
+
data.DbConnectionSettings
+
Auxiliary class for caching the connection parameters
Author
Josef Poetzl
+
+
+
+
Properties
+
+
+
+
SqlDateFormat
+
Date format string
+
+
+
+
SqlWildCardString
+
SQL wildcard
+
+
+
+
SqlBooleanTrueString
+
SQL string for boolean true
+
+
+
+
DefaultAdodbCursorLocation
+
Default parameter value for ADODB.CursorLocationEnum
+
+
+
+
OpenPermanentBackendRecordset
+
Open permanent backend recordset if connected
+
+
+
+
Clone
+
Clone of current config
+
+
+
+
CopyFrom
+
Copy DbConnectionSettings
Parameters
NewSettings
DbConnectionSettings to copy
+
+
+
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/adodb/AdodbHandler-Summary.js b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/adodb/AdodbHandler-Summary.js
new file mode 100644
index 0000000..9d666eb
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/adodb/AdodbHandler-Summary.js
@@ -0,0 +1 @@
+NDFramePage.OnPageTitleLoaded("VisualBasicClass:data.adodb.AdodbHandler","AdodbHandler");NDSummary.OnSummaryLoaded("VisualBasicClass:data.adodb.AdodbHandler",[["Visual Basic","VisualBasic"]],[["Classes","Class"],["Events","Event"],["Functions","Function"],["Groups","Group"],["Properties","Property"]],[[19,0,0,"data.adodb.AdodbHandler"],[20,0,3,"Events","Events"],[21,0,1,"ErrorMissingCurrentConnection","ErrorMissingCurrentConnection"],[22,0,1,"ErrorEmptyOledbConnectionString","ErrorEmptyOledbConnectionString"],[23,0,1,"HookInsertIdentityReturn","HookInsertIdentityReturn"],[24,0,3,"Class control","Class_control"],[25,0,4,"HooksEnabled","HooksEnabled"],[26,0,3,"Data Connection","Data_Connection"],[27,0,4,"CurrentConnection","CurrentConnection"],[28,0,4,"ConnectionString","ConnectionString"],[29,0,3,"Data Operations","Data_Operations"],[30,0,2,"Execute","Execute"],[31,0,2,"ExecuteCommand","ExecuteCommand"],[32,0,2,"OpenRecordset","OpenRecordset"],[33,0,2,"OpenRecordsetCommandParam","OpenRecordsetCommandParam"],[34,0,2,"LookupSQL","LookupSQL"],[35,0,2,"Lookup","Lookup"],[36,0,2,"Count","Count"],[37,0,2,"Max","Max"],[38,0,2,"Min","Min"],[39,0,2,"Sum","Sum"],[40,0,2,"Exists","Exists"],[41,0,2,"InsertIdentityReturn","InsertIdentityReturn"],[42,0,2,"InsertValuesIdentityReturn","InsertValuesIdentityReturn"],[43,0,2,"ValueList","ValueList"],[44,0,2,"LookupSqlValueCollection","LookupSqlValueCollection"]]);
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/adodb/AdodbHandler-SummaryToolTips.js b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/adodb/AdodbHandler-SummaryToolTips.js
new file mode 100644
index 0000000..18d8388
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/adodb/AdodbHandler-SummaryToolTips.js
@@ -0,0 +1 @@
+NDSummary.OnToolTipsLoaded("VisualBasicClass:data.adodb.AdodbHandler",{19:"
ADODB data connection methods
",21:"
Event for missing ADODB connection reference (Passing the AdodbHandler event: data.adodb.AdodbHandler::ErrorMissingCurrentConnection)
",22:"
Event for missing OLEDB connection string
",23:"
Event for missing OLEDB connection string
",25:"
Active Hooks
",27:"
Currently set ADODB connection
",28:"
OLEDB connection string
",30:"
Public Function Execute(
ByVal CommandText
As
String,
Optional ByRef RecordsAffected
As
Long,
Optional ByVal Options
As
ADODB.ExecuteOptionEnum
=
-1
) As ADODB.Recordset
Execute SQL statement
",31:"
Public Function ExecuteCommand(
ByVal CmdText
As
String,
ByVal CmdType
As
ADODB.CommandTypeEnum,
Optional ByVal CmdParamDefs
As
Variant,
Optional ByRef RecordsAffected
As
Long,
Optional ByVal Options
As
Long
=
-1
) As ADODB.Recordset
Execute sql statement using ADODB.Command
",32:"
Public Function OpenRecordset(
ByVal Source
As
String,
Optional ByVal CursorType
As
ADODB.CursorTypeEnum
=
ADODB.CursorTypeEnum.adOpenForwardOnly,
Optional ByVal LockType
As
ADODB.LockTypeEnum
=
ADODB.LockTypeEnum.adLockReadOnly,
Optional ByVal CursorLocation
As
ADODB.CursorLocationEnum
=
-1,
Optional ByVal DisconnectedRecordset
As
Boolean
=
False
) As ADODB.Recordset
Optimizes ADODB.Recordset.Open method
",33:"
Public Function OpenRecordsetCommandParam(
ByVal CmdText
As
String,
ByVal CmdType
As
ADODB.CommandTypeEnum,
Optional ByVal CmdParamDefs
As
Variant,
Optional ByRef RecordsAffected
As
Long,
Optional ByVal Options
As
Long
=
-1,
Optional ByVal DisconnectedRecordset
As
Boolean
=
False
) As ADODB.Recordset
Open recordset using ADODB.Command
",34:"
Public Function LookupSql(
ByVal SqlText
As
String,
Optional ByVal Index
As
Variant
=
0&,
Optional ByVal ValueIfNull
As
Variant
=
Null
) As Variant
Lookup ADODB.Recordset replacement function for DLookup (passing a SQL statement)
",35:"
Public Function Lookup(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant,
Optional ByVal ValueIfNull
As
Variant
=
Null
) As Variant
ADODB.Recordset replacement function for DLookup
",36:"
Public Function Count(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Long
ADODB.Recordset replacement function for DCount
",37:"
Public Function Max(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
ADODB.Recordset replacement function for DMax
",38:"
Public Function Min(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
ADODB.Recordset replacement function for DMin
",39:"
Public Function Sum(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
ADODB.Recordset replacement function for DSum
",40:"
Public Function Exists(
ByVal Domain
As
String,
Optional ByVal Criteria
As
String
=
vbNullString
) As Boolean
Check if record exists
",41:"
Public Function InsertIdentityReturn(
ByVal InsertSql
As
String,
Optional ByVal IdentityTable
As
String
=
vbNullString
) As Variant
Execute insert SQL statement and return last identity value (auto value)
",42:"
Public Function InsertValuesIdentityReturn(
ByVal Source
As
String,
ParamArray InsertFields()
As
Variant
) As Variant
Create and execute insert SQL statement and return last identity value (auto value)
",43:"
Public Function ValueList(
ByVal SqlSource
As
String,
Optional ByVal ListConcatString
As
String
=
", ",
Optional ValueIfNull
As
Variant
=
Null
) As Variant
Generate concat string from recordset result
",44:"
Public Function LookupSqlValueCollection(
ByVal SqlSource
As
String,
Optional ByVal ValueIfNull
As
Variant
=
Null
) As Collection
Generate collection from recordset result
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/adodb/AdodbHandler-ToolTips.js b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/adodb/AdodbHandler-ToolTips.js
new file mode 100644
index 0000000..b81dece
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/adodb/AdodbHandler-ToolTips.js
@@ -0,0 +1 @@
+NDContentPage.OnToolTipsLoaded({21:"
Event for missing ADODB connection reference (Passing the AdodbHandler event: data.adodb.AdodbHandler::ErrorMissingCurrentConnection)
",27:"
Currently set ADODB connection
",28:"
OLEDB connection string
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/adodb/AdodbHandler.html b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/adodb/AdodbHandler.html
new file mode 100644
index 0000000..6d2e1db
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/adodb/AdodbHandler.html
@@ -0,0 +1,152 @@
+
+
+AdodbHandler
+
+
+
+
+
+
+
+
Message about the cause of the event triggering. (Not yet used)
NewConnectionString
OLEDB Connectionstring
Remarks
The appropriate OLEDB connection string can be passed on via the ByRef parameter NewConnectionString.
+
+
+
+
HookInsertIdentityReturn
+
Event for missing OLEDB connection string
Parameters
InsertSql
SQL text of insert statement
IdentityTable
Identity table
ActiveConnection
ADODB Connection to use
IdentitySelectString
Input string to use
HookResponseMode
resume action after event call: 0 ... code resume after event, 1 exit function after event
HookResponseMessage
return value of function (e.g. InsertIdentityReturn) when HookResumeMode <> 0
Remarks
New values can be passed on via the ByRef parameters.
+
+
+
+
Class control
+
+
+
+
HooksEnabled
+
Active Hooks
Remarks
Used in InsertIdentityReturn
+
+
+
+
Data Connection
+
+
+
+
CurrentConnection
+
Get
Currently set ADODB connection
Set
Set new ADODB connection
Remarks
If there is no ADODB connection yet, a new ADODB connection will be created. Instantiation flow: 1. raiseEvent #ErrorMissingCurrentConnection ... if no connection was passed: 2. create new ADODB connection based on the OLEDB connection string (use property data.adodb.AdodbHandler::ConnectionString)
If a reference to an ADODB connection already exists, it will be checked if it is closed and opened if necessary.
+
+
+
+
ConnectionString
+
OLEDB connection string
+
+
+
+
Data Operations
+
+
+
+
Execute
+
Public Function Execute(
ByVal CommandText
As
String,
Optional ByRef RecordsAffected
As
Long,
Optional ByVal Options
As
ADODB.ExecuteOptionEnum
=
-1
) As ADODB.Recordset
+
Execute SQL statement
Parameters
CommandText
SQL statement
RecordsAffected
ByRef parameter to return the number of records affected by the Execute statement.
Options
additional options of the ADODB.Connection.Execute method
Returns
ADODB.Recordset
Remarks
Encapsulation of the ADODB.Connection.Execute method (parameters are passed on 1:1)
ByRef parameter to return the number of records affected by the Execute statement.
Options
additional options of the ADODB.Command.Execute method
Returns
ADODB.Recordset
Remarks
With this variant, SQL injection can be avoided very easily, since the parameters are not built directly into the SQL statement and thus a parameter value (which comes from a user input, for example) cannot inject an SQL statement.
+
+
+
+
OpenRecordset
+
Public Function OpenRecordset(
ByVal Source
As
String,
Optional ByVal CursorType
As
ADODB.CursorTypeEnum
=
ADODB.CursorTypeEnum.adOpenForwardOnly,
Optional ByVal LockType
As
ADODB.LockTypeEnum
=
ADODB.LockTypeEnum.adLockReadOnly,
Optional ByVal CursorLocation
As
ADODB.CursorLocationEnum
=
-1,
Optional ByVal DisconnectedRecordset
As
Boolean
=
False
) As ADODB.Recordset
+
Optimizes ADODB.Recordset.Open method
Parameters
Source
Data source (e.g. SQL statement)
CursorType
ADODB.CursorTypeEnum value
LockType
ADODB.LockTypeEnum value
CursorLocation
ADODB.CursorLocationEnum value
DisconnectedRecordset
True: disconnect connection from recordset after opening
ByRef parameter to return the number of records affected by the Execute statement.
Options
additional options of the ADODB.Command.Execute method
DisconnectedRecordset
True: disconnect connection from recordset after opening
Returns
ADODB.Recordset
Remarks
With this variant, SQL injection can be avoided very easily, since the parameters are not built directly into the SQL statement and thus a parameter value (which comes from a user input, for example) cannot inject an SQL statement.
+
+
+
+
LookupSQL
+
Public Function LookupSql(
ByVal SqlText
As
String,
Optional ByVal Index
As
Variant
=
0&,
Optional ByVal ValueIfNull
As
Variant
=
Null
) As Variant
+
Lookup ADODB.Recordset replacement function for DLookup (passing a SQL statement)
Parameters
SqlText
SQL statement
Index
Field selection if the first field of the recordset is not to be returned. The index is passed in the same way as ADODB.Recordset.Fields(index).
ValueIfNull
Return value if record is missing or data field value is Null (default: Null).
Returns
Variant
Null, if SQL statement does not return a record.
Remarks
The SQL statement must be written in the SQL dialect of the DBMS concerned.
+
+
+
+
Lookup
+
Public Function Lookup(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant,
Optional ByVal ValueIfNull
As
Variant
=
Null
) As Variant
+
ADODB.Recordset replacement function for DLookup
Parameters
Expr
Field name or calculated expression (select part)
Domain
Table, query or SQL expression for sub-query (FROM part)
Criteria
(Optional) Criteria string (WHERE part)
ValueIfNull
Return value if record is missing or data field value is Null (default: Null).
Returns
Variant
+
+
+
+
Count
+
Public Function Count(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Long
+
ADODB.Recordset replacement function for DCount
Parameters
Expr
Field name or calculated expression (select part)
Domain
Table, query or SQL expression for sub-query (FROM part)
Criteria
(Optional) Criteria string (WHERE part)
Returns
Long
+
+
+
+
Max
+
Public Function Max(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
+
ADODB.Recordset replacement function for DMax
Parameters
Expr
Field name or calculated expression (select part)
Domain
Table, query or SQL expression for sub-query (FROM part)
Criteria
(Optional) Criteria string (WHERE part)
Returns
Variant
+
+
+
+
Min
+
Public Function Min(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
+
ADODB.Recordset replacement function for DMin
Parameters
Expr
Field name or calculated expression (select part)
Domain
Table, query or SQL expression for sub-query (FROM part)
Criteria
(Optional) Criteria string (WHERE part)
Returns
Variant
+
+
+
+
Sum
+
Public Function Sum(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
+
ADODB.Recordset replacement function for DSum
Parameters
Expr
Field name or calculated expression (select part)
Domain
Table, query or SQL expression for sub-query (FROM part)
Criteria
(Optional) Criteria string (WHERE part)
Returns
Variant
+
+
+
+
Exists
+
Public Function Exists(
ByVal Domain
As
String,
Optional ByVal Criteria
As
String
=
vbNullString
) As Boolean
+
Check if record exists
Parameters
Domain
data source (FROM part)
Criteria
(Optional) Criteria string (WHERE part)
Returns
Boolean
+
+
+
+
InsertIdentityReturn
+
Public Function InsertIdentityReturn(
ByVal InsertSql
As
String,
Optional ByVal IdentityTable
As
String
=
vbNullString
) As Variant
+
Execute insert SQL statement and return last identity value (auto value)
Parameters
InsertSQL
Insert SQL statement
Returns
Identity value or NULL if no record was appended
Remarks
Works for Jet only from Jet 4.0 (Access 2000), IdentityTable is only applicable for MSSQL, under MySQL the IDENT_CURRENT function does not exist.
+
+
+
+
InsertValuesIdentityReturn
+
Public Function InsertValuesIdentityReturn(
ByVal Source
As
String,
ParamArray InsertFields()
As
Variant
) As Variant
+
Create and execute insert SQL statement and return last identity value (auto value)
Works for Jet only from Jet 4.0 (Access 2000), IdentityTable is only applicable for MSSQL, under MySQL the IDENT_CURRENT function does not exist.
+
+
+
+
ValueList
+
Public Function ValueList(
ByVal SqlSource
As
String,
Optional ByVal ListConcatString
As
String
=
", ",
Optional ValueIfNull
As
Variant
=
Null
) As Variant
+
Generate concat string from recordset result
Parameters
SqlSource
Select statement
ListConcatString
(optional) Character to join results, Default = ", "
ValueIfNull
(optional) Value if no results, Default = Null
Returns
Variant
result exists: string, no result exists: ValueIfNull
+
+
+
+
LookupSqlValueCollection
+
Public Function LookupSqlValueCollection(
ByVal SqlSource
As
String,
Optional ByVal ValueIfNull
As
Variant
=
Null
) As Collection
+
Generate collection from recordset result
Parameters
SqlSource
Select statement
ValueIfNull
(optional) Value if no results, Default = Null
Returns
Collection
+
+
+
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/dao/DaoHandler-Summary.js b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/dao/DaoHandler-Summary.js
new file mode 100644
index 0000000..4233cfb
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/dao/DaoHandler-Summary.js
@@ -0,0 +1 @@
+NDFramePage.OnPageTitleLoaded("VisualBasicClass:data.dao.DaoHandler","DaoHandler");NDSummary.OnSummaryLoaded("VisualBasicClass:data.dao.DaoHandler",[["Visual Basic","VisualBasic"]],[["Classes","Class"],["Events","Event"],["Functions","Function"],["Groups","Group"],["Properties","Property"]],[[80,0,0,"data.dao.DaoHandler"],[81,0,3,"Events","Events"],[82,0,1,"ErrorMissingCurrentDb","ErrorMissingCurrentDb"],[83,0,3,"Class control","Class_control"],[84,0,2,"Dispose","Dispose"],[85,0,2,"InitRecordsetEnumDefaultValues","InitRecordsetEnumDefaultValues"],[86,0,3,"Data Connection","Data_Connection"],[87,0,4,"CurrentDb","CurrentDb"],[88,0,3,"Data Operations","Data_Operations"],[89,0,2,"Execute","Execute"],[90,0,2,"ExecuteParamSQL","ExecuteParamSQL"],[91,0,2,"ExecuteQueryDefByName","ExecuteQueryDefByName"],[92,0,2,"ExecuteQueryDef","ExecuteQueryDef"],[93,0,2,"ParamQueryDefByName","ParamQueryDefByName"],[94,0,2,"ParamQueryDefSql","ParamQueryDefSql"],[95,0,2,"OpenRecordset","OpenRecordset"],[96,0,2,"OpenRecordsetParamSQL","OpenRecordsetParamSQL"],[97,0,2,"OpenRecordsetParamSql2","OpenRecordsetParamSql2"],[98,0,2,"GetParamDefArray","GetParamDefArray"],[99,0,2,"GetNamedParamDefArray","GetNamedParamDefArray"],[100,0,2,"OpenRecordsetQueryDefByName","OpenRecordsetQueryDefByName"],[101,0,2,"OpenRecordsetQueryDef","OpenRecordsetQueryDef"],[102,0,2,"LookupSQL","LookupSQL"],[103,0,2,"Lookup","Lookup"],[104,0,2,"Count","Count"],[105,0,2,"Max","Max"],[106,0,2,"Min","Min"],[107,0,2,"Sum","Sum"],[108,0,2,"Exists","Exists"],[109,0,2,"InsertIdentityReturn","InsertIdentityReturn"],[110,0,2,"InsertValues","InsertValues"],[111,0,2,"InsertValuesReturnFieldValue","InsertValuesReturnFieldValue"],[112,0,2,"NewRecord","NewRecord"],[113,0,2,"CopyRecord","CopyRecord"],[114,0,2,"CopyRecords","CopyRecords"],[115,0,2,"CopyRecordsReturnFieldValue","CopyRecordsReturnFieldValue"]]);
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/dao/DaoHandler-SummaryToolTips.js b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/dao/DaoHandler-SummaryToolTips.js
new file mode 100644
index 0000000..95b72a8
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/dao/DaoHandler-SummaryToolTips.js
@@ -0,0 +1 @@
+NDSummary.OnToolTipsLoaded("VisualBasicClass:data.dao.DaoHandler",{80:"
DAO data connection methods
",82:"
Event for missing CurrentDb reference
",84:"
Public Sub Dispose()
Remove object references
",85:"
Public Sub InitRecordsetEnumDefaultValues(
Optional ByRef RecordsetType
As
DAO.RecordsetTypeEnum,
Optional ByRef Options
As
DAO.RecordsetOptionEnum,
Optional ByRef LockEdit
As
DAO.LockTypeEnum
)
Set default values for recordset enums, which are used when parameters cannot be set.
",87:"
CurrentDbC variant
",89:"
Public Function Execute(
ByVal Query
As
String,
Optional ByVal Options
As
DAO.RecordsetOptionEnum
) As Long
Execute SQL statement
",90:"
Public Function ExecuteParamSql(
ByVal SqlText
As
String,
ParamArray QueryParams()
As
Variant
) As Long
Execute SQL statement with parameters
",91:"
Public Function ExecuteQueryDefByName(
ByVal QueryName
As
String,
ParamArray QueryParams()
As
Variant
) As Long
Execute saved query (optionally with parameters)
",92:"
Public Function ExecuteQueryDef(
ByVal QdfRef
As
DAO.QueryDef,
ParamArray QueryParams()
As
Variant
) As Long
Fill QueryDef object with parameter values and then execute it
",93:"
Public Function ParamQueryDefByName(
ByVal QueryName
As
String,
ParamArray QueryParams()
As
Variant
) As DAO.QueryDef
Open saved query as QueryDef object incl. passed parameter values
Open parameter SQL statement (uses temporary QueryDef)
",97:"
Public Function OpenRecordsetParamSql2(
ByVal ParamSqlText
As
String,
ParamArray QueryParams()
As
Variant
) As DAO.Recordset
Open parameter SQL statement (like OpenRecordsetParamSQL, but with default values for RecordsetType, RecordsetOptions and LockEdit)
",98:"
Public Function GetParamDefArray(
ParamArray ParamValues()
As
Variant
) As Variant
Creates 2-dimensional parameter array (e.g. for OpenRecordsetQueryDef)
",99:"
Public Function GetNamedParamDefArray(
ParamArray ParamIndexAndValues()
As
Variant
) As Variant
Creates 2-dimensional parameter array (e.g. for OpenRecordsetQueryDef)
",100:"
Public Function OpenRecordsetQueryDefByName(
ByVal QueryName
As
String,
Optional ByVal QueryParams
As
Variant,
Optional ByVal RecordsetType
As
DAO.RecordsetTypeEnum,
Optional ByVal Options
As
DAO.RecordsetOptionEnum,
Optional ByVal LockEdit
As
DAO.LockTypeEnum
) As DAO.Recordset
Open recordset from saved query (optionally with parameters)
",101:"
Public Function OpenRecordsetQueryDef(
ByVal QdfRef
As
DAO.QueryDef,
Optional ByVal QueryParams
As
Variant,
Optional ByVal RecordsetType
As
DAO.RecordsetTypeEnum,
Optional ByVal RecordsetOptions
As
DAO.RecordsetOptionEnum,
Optional ByVal LockEdit
As
DAO.LockTypeEnum
) As DAO.Recordset
Recordset von gespeicherter Abfrage (optional mit Parametern) öffnen
",102:"
Public Function LookupSql(
ByVal SqlText
As
String,
Optional ByVal Index
As
Variant
=
0&,
Optional ByVal ValueIfNull
As
Variant
=
Null
) As Variant
Lookup DAO.Recordset replacement function for DLookup (passing a SQL statement)
",103:"
Public Function Lookup(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant,
Optional ByVal ValueIfNull
As
Variant
=
Null
) As Variant
DAO.Recordset replacement function for DLookup
",104:"
Public Function Count(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Long
DAO.Recordset replacement function for DCount
",105:"
Public Function Max(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
DAO.Recordset replacement function for DMax
",106:"
Public Function Min(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
DAO.Recordset replacement function for DMin
",107:"
Public Function Sum(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
DAO.Recordset replacement function for DSum
",108:"
Public Function Exists(
ByVal Domain
As
String,
Optional ByVal Criteria
As
String
=
vbNullString
) As Boolean
Check if record exists
",109:"
Public Function InsertIdentityReturn(
ByVal InsertSql
As
String
) As Variant
Execute insert SQL statement and return last identity value (auto value)
",110:"
Public Function InsertValues(
ByVal Source
As
String,
ParamArray FieldsAndValues()
As
Variant
) As Boolean
Open recordset and append values
",111:"
Public Function InsertValuesReturnFieldValue(
ByVal Source
As
String,
ByVal ReturnFieldNameOrIndex
As
Variant,
ParamArray FieldsAndValues()
As
Variant
) As Variant
Ropen ecordset and append values, returns value of a defined data field
",112:"
Public Function NewRecord(
ByVal Source
As
String,
ByVal ReturnFieldName
As
String,
ParamArray FieldsAndValues()
As
Variant
) As Variant
Append record via recordset and set field values.
",113:"
Public Function CopyRecord(
ByVal Source
As
String,
ByVal StartFieldNumber
As
Long,
ByVal LastFieldNumber
As
Long,
ByVal ReturnFieldName
As
String,
ParamArray DataToChange()
As
Variant
) As Variant
Copy data set and change individual values
",114:"
Public Function CopyRecords(
ByVal Source
As
String,
ByVal StartFieldNumber
As
Long,
ByVal LastFieldNumber
As
Long,
ParamArray DataToChange()
As
Variant
) As Boolean
Recordset öffnen und Werte eines Datensatzes anfügen
",115:"
Public Function CopyRecordsReturnFieldValue(
ByVal Source
As
String,
ByVal StartFieldNumber
As
Long,
ByVal LastFieldNumber
As
Long,
ByVal ReturnFieldName
As
String,
ParamArray DataToChange()
As
Variant
) As Variant
/** <summary> Datensätze kopieren und Werte ändern
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/dao/DaoHandler-ToolTips.js b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/dao/DaoHandler-ToolTips.js
new file mode 100644
index 0000000..b740606
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/dao/DaoHandler-ToolTips.js
@@ -0,0 +1 @@
+NDContentPage.OnToolTipsLoaded({41:"
Public Function InsertIdentityReturn(
ByVal InsertSql
As
String,
Optional ByVal IdentityTable
As
String
=
vbNullString
) As Variant
Execute insert SQL statement and return last identity value (auto value)
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/dao/DaoHandler.html b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/dao/DaoHandler.html
new file mode 100644
index 0000000..519cee6
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/dao/DaoHandler.html
@@ -0,0 +1,216 @@
+
+
+DaoHandler
+
+
+
+
+
+
+
+
+
data.dao.DaoHandler
+
DAO data connection methods
Author
Josef Poetzl
+
+
+
+
Events
+
+
+
+
ErrorMissingCurrentDb
+
Event for missing CurrentDb reference
Parameters
Msg
Message about the cause of the event triggering. (Not yet used)
NewCurrentDbRef
DAO.Database reference to be used for CurrentDb
Remarks
The required DAO.Database reference can be passed on via the ByRef parameter NewCurrentDbRef.
+
+
+
+
Class control
+
+
+
+
Dispose
+
Public Sub Dispose()
+
Remove object references
+
+
+
+
InitRecordsetEnumDefaultValues
+
Public Sub InitRecordsetEnumDefaultValues(
Optional ByRef RecordsetType
As
DAO.RecordsetTypeEnum,
Optional ByRef Options
As
DAO.RecordsetOptionEnum,
Optional ByRef LockEdit
As
DAO.LockTypeEnum
)
+
Set default values for recordset enums, which are used when parameters cannot be set.
Parameters
RecordsetType
DAO.RecordsetTypeEnum
Options
DAO.RecordsetOptionEnum
LockEdit
DAO.LockTypeEnum
Remarks
If 0 is set, standard of DAO is used (0 parameters are passed on to DAO as "IsMissing" variant value).
+
+
+
+
Data Connection
+
+
+
+
CurrentDb
+
CurrentDbC variant
Returns
DAO.Database
Remarks
CurrentDbC variant which, unlike the original version by Michael Kaplan, does not automatically set the DAO database reference to Access.Application.CurrentDb, but requests it via an event if no reference exists yet. This allows any database reference to be passed via the main application. (e.g. if a temp database is to serve as CurrentDb).
+
+
+
+
Data Operations
+
+
+
+
Execute
+
Public Function Execute(
ByVal Query
As
String,
Optional ByVal Options
As
DAO.RecordsetOptionEnum
) As Long
+
Execute SQL statement
Parameters
CommandText
SQL statement (String)
Options
DAO.RecordsetOptionEnum
Returns
RecordsAffected (Long)
+
+
+
+
ExecuteParamSQL
+
Public Function ExecuteParamSql(
ByVal SqlText
As
String,
ParamArray QueryParams()
As
Variant
) As Long
+
Execute SQL statement with parameters
Parameters
SqlText
SQL statement
QueryParams
Values in suitable order as ParamArray or as array or 2-dimensional parameter array (Array(n,1) ... x(n,0) = parameter name, x(n,1) = parameter value) ... generateable with GetParamDefArray or GetNamedParamDefArray
Returns
RecordsAffected (Long)
+
+
+
+
ExecuteQueryDefByName
+
Public Function ExecuteQueryDefByName(
ByVal QueryName
As
String,
ParamArray QueryParams()
As
Variant
) As Long
+
Execute saved query (optionally with parameters)
Parameters
QueryName
QueryDef name
QueryParams
Values in suitable order as ParamArray or as array or 2-dimensional parameter array (Array(n,1) ... x(n,0) = parameter name, x(n,1) = parameter value) ... generateable with GetParamDefArray or GetNamedParamDefArray
Returns
RecordsAffected (Long)
+
+
+
+
ExecuteQueryDef
+
Public Function ExecuteQueryDef(
ByVal QdfRef
As
DAO.QueryDef,
ParamArray QueryParams()
As
Variant
) As Long
+
Fill QueryDef object with parameter values and then execute it
Parameters
QdfRef
QueryDef reference
QueryParams
Values in suitable order as ParamArray or as array or 2-dimensional parameter array (Array(n,1) ... x(n,0) = parameter name, x(n,1) = parameter value) ... generateable with GetParamDefArray or GetNamedParamDefArray
Returns
RecordsAffected (Long)
+
+
+
+
ParamQueryDefByName
+
Public Function ParamQueryDefByName(
ByVal QueryName
As
String,
ParamArray QueryParams()
As
Variant
) As DAO.QueryDef
+
Open saved query as QueryDef object incl. passed parameter values
Parameters
QueryName
name of query with parameters
QueryParams
Values in suitable order as ParamArray or as array or 2-dimensional parameter array (Array(n,1) ... x(n,0) = parameter name, x(n,1) = parameter value) ... generateable with GetParamDefArray or GetNamedParamDefArray
Values in suitable order as ParamArray or as array or 2-dimensional parameter array (Array(n,1) ... x(n,0) = parameter name, x(n,1) = parameter value) ... generateable with GetParamDefArray or GetNamedParamDefArray
Returns
DAO.QueryDef
+
+
+
+
OpenRecordset
+
Public Function OpenRecordset(
ByVal Source
As
String,
Optional ByVal RecordsetType
As
DAO.RecordsetTypeEnum
=
dbOpenDynaset,
Optional ByVal RecordsetOptions
As
DAO.RecordsetOptionEnum
=
DAO.RecordsetOptionEnum.dbSeeChanges,
Optional ByVal LockEdit
As
DAO.LockTypeEnum
) As DAO.Recordset
+
Open DAO.Recordset
Parameters
Source
SQL statement or table or query name
RecordsetType
DAO.RecordsetTypeEnum (Standard: dbOpenDynaset)
RecordsetOptions
DAO.RecordsetOptionEnum (Standard: dbSeeChanges)
LockEdit
DAO.LockTypeEnum (Standard: dbOptimistic)
Returns
DAO.Recordset
+
+
+
+
OpenRecordsetParamSQL
+
Public Function OpenRecordsetParamSql(
ByVal ParamSqlText
As
String,
ByVal RecordsetType
As
DAO.RecordsetTypeEnum,
ByVal Options
As
DAO.RecordsetOptionEnum,
ByVal LockEdit
As
DAO.LockTypeEnum,
ParamArray QueryParams()
As
Variant
) As DAO.Recordset
+
Open parameter SQL statement (uses temporary QueryDef)
Parameters
ParamSqlText
SQL statement with parameters (parameter declaration)
RecordsetType
DAO.RecordsetTypeEnum (Standard: dbOpenDynaset)
RecordsetOptions
DAO.RecordsetOptionEnum (Standard: dbSeeChanges)
LockEdit
DAO.LockTypeEnum (Standard: dbOptimistic)
QueryParams
Values in suitable order as ParamArray or as array or 2-dimensional parameter array (Array(n,1) ... x(n,0) = parameter name, x(n,1) = parameter value) ... generateable with GetParamDefArray or GetNamedParamDefArray
Returns
DAO.Recordset
+
+
+
+
OpenRecordsetParamSql2
+
Public Function OpenRecordsetParamSql2(
ByVal ParamSqlText
As
String,
ParamArray QueryParams()
As
Variant
) As DAO.Recordset
+
Open parameter SQL statement (like OpenRecordsetParamSQL, but with default values for RecordsetType, RecordsetOptions and LockEdit)
Parameters
ParamSqlText
SQL statement with parameters (parameter declaration)
QueryParams
Values in suitable order as ParamArray or as array or 2-dimensional parameter array (Array(n,1) ... x(n,0) = parameter name, x(n,1) = parameter value) ... generateable with GetParamDefArray or GetNamedParamDefArray'
Returns
DAO.Recordset
+
+
+
+
GetParamDefArray
+
Public Function GetParamDefArray(
ParamArray ParamValues()
As
Variant
) As Variant
+
Creates 2-dimensional parameter array (e.g. for OpenRecordsetQueryDef)
Parameters
ParamValues
Parmeter values in matching order (without index identifier!)
Returns
Variant (Array)
+
+
+
+
GetNamedParamDefArray
+
Public Function GetNamedParamDefArray(
ParamArray ParamIndexAndValues()
As
Variant
) As Variant
+
Creates 2-dimensional parameter array (e.g. for OpenRecordsetQueryDef)
Parameters
ParamValues
Parameter pairs: alternating parameter index and parameter value
Returns
Variant (Array)
+
+
+
+
OpenRecordsetQueryDefByName
+
Public Function OpenRecordsetQueryDefByName(
ByVal QueryName
As
String,
Optional ByVal QueryParams
As
Variant,
Optional ByVal RecordsetType
As
DAO.RecordsetTypeEnum,
Optional ByVal Options
As
DAO.RecordsetOptionEnum,
Optional ByVal LockEdit
As
DAO.LockTypeEnum
) As DAO.Recordset
+
Open recordset from saved query (optionally with parameters)
Parameters
QueryName
Name of the saved query
QueryParams
Values in suitable order as ParamArray or as array or 2-dimensional parameter array (Array(n,1) ... x(n,0) = parameter name, x(n,1) = parameter value) ... generateable with GetParamDefArray or GetNamedParamDefArray'
RecordsetType
DAO.RecordsetTypeEnum (Standard: dbOpenDynaset)
RecordsetOptions
DAO.RecordsetOptionEnum (Standard: dbSeeChanges)
LockEdit
DAO.LockTypeEnum (Standard: dbOptimistic)
Returns
DAO.Recordset
+
+
+
+
OpenRecordsetQueryDef
+
Public Function OpenRecordsetQueryDef(
ByVal QdfRef
As
DAO.QueryDef,
Optional ByVal QueryParams
As
Variant,
Optional ByVal RecordsetType
As
DAO.RecordsetTypeEnum,
Optional ByVal RecordsetOptions
As
DAO.RecordsetOptionEnum,
Optional ByVal LockEdit
As
DAO.LockTypeEnum
) As DAO.Recordset
+
Recordset von gespeicherter Abfrage (optional mit Parametern) öffnen
Parameters
QdfRef
QueryDef reference
QueryParams
Values in suitable order as ParamArray or as array or 2-dimensional parameter array (Array(n,1) ... x(n,0) = parameter name, x(n,1) = parameter value) ... generateable with GetParamDefArray or GetNamedParamDefArray'
RecordsetType
DAO.RecordsetTypeEnum (Standard: dbOpenDynaset)
RecordsetOptions
DAO.RecordsetOptionEnum (Standard: dbSeeChanges)
LockEdit
DAO.LockTypeEnum (Standard: dbOptimistic)
Returns
DAO.Recordset
+
+
+
+
LookupSQL
+
Public Function LookupSql(
ByVal SqlText
As
String,
Optional ByVal Index
As
Variant
=
0&,
Optional ByVal ValueIfNull
As
Variant
=
Null
) As Variant
+
Lookup DAO.Recordset replacement function for DLookup (passing a SQL statement)
Parameters
SqlText
SQL statement
Index
Field selection if the first field of the recordset is not to be returned. The index is passed in the same way as ADODB.Recordset.Fields(index).
ValueIfNull
Return value if record is missing or data field value is Null (default: Null).
Returns
Variant
Null, if SQL statement does not return a record.
Remarks
The SQL statement must be written in the Jet/ACE SQL dialect.
+
+
+
+
Lookup
+
Public Function Lookup(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant,
Optional ByVal ValueIfNull
As
Variant
=
Null
) As Variant
+
DAO.Recordset replacement function for DLookup
Parameters
Expr
Field name or calculated expression (select part)
Domain
Table, query or SQL expression for sub-query (FROM part)
Criteria
(Optional) Criteria string (WHERE part)
ValueIfNull
Return value if record is missing or data field value is Null (default: Null).
Returns
Variant
+
+
+
+
Count
+
Public Function Count(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Long
+
DAO.Recordset replacement function for DCount
Parameters
Expr
Field name or calculated expression (select part)
Domain
Table, query or SQL expression for sub-query (FROM part)
Criteria
(optional) Criteria string (WHERE part)
Returns
Long
+
+
+
+
Max
+
Public Function Max(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
+
DAO.Recordset replacement function for DMax
Parameters
Expr
Field name or calculated expression (select part)
Domain
Table, query or SQL expression for sub-query (FROM part)
Criteria
(Optional) Criteria string (WHERE part)
Returns
Variant
+
+
+
+
Min
+
Public Function Min(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
+
DAO.Recordset replacement function for DMin
Parameters
Expr
Field name or calculated expression (select part)
Domain
Table, query or SQL expression for sub-query (FROM part)
Criteria
(Optional) Criteria string (WHERE part)
Returns
Variant
+
+
+
+
Sum
+
Public Function Sum(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
+
DAO.Recordset replacement function for DSum
Parameters
Expr
Field name or calculated expression (select part)
Domain
Table, query or SQL expression for sub-query (FROM part)
Criteria
(Optional) Criteria string (WHERE part)
Returns
Variant
+
+
+
+
Exists
+
Public Function Exists(
ByVal Domain
As
String,
Optional ByVal Criteria
As
String
=
vbNullString
) As Boolean
+
Check if record exists
Parameters
Domain
data source (FROM part)
Criteria
(Optional) Criteria string (WHERE part)
Returns
Boolean
+
+
+
+
InsertIdentityReturn
+
Public Function InsertIdentityReturn(
ByVal InsertSql
As
String
) As Variant
+
Execute insert SQL statement and return last identity value (auto value)
Parameters
InsertSQL
Insert SQL statement
Returns
Identity value or NULL if no record was appended
Remarks
Works for Jet only from Jet 4.0 (Access 2000), IdentityTable is only applicable for MSSQL, under MySQL the IDENT_CURRENT function does not exist. (data.adodb.AdodbHandler::InsertIdentityReturn is more suitable regarding use for active DBMS.)
Since a recordset is used for insertion, there is no data type check in the code -> watch out for implicit conversion.
+
+
+
+
NewRecord
+
Public Function NewRecord(
ByVal Source
As
String,
ByVal ReturnFieldName
As
String,
ParamArray FieldsAndValues()
As
Variant
) As Variant
+
Append record via recordset and set field values.
Parameters
Source
Data source (table name or SQL statement)
ReturnFieldName
Field name whose value is to be returned (e.g. autonumber field).
FieldsAndValues
new data ... ParamArray: "Field1", Value1, "Field2", Value2, ....
Returns
Value from ReturnFieldName, or True/False if no ReturnFieldName was specified.
+
+
+
+
CopyRecord
+
Public Function CopyRecord(
ByVal Source
As
String,
ByVal StartFieldNumber
As
Long,
ByVal LastFieldNumber
As
Long,
ByVal ReturnFieldName
As
String,
ParamArray DataToChange()
As
Variant
) As Variant
+
Copy data set and change individual values
Parameters
Source
Data source (table name or SQL statement)
StartFieldNumber
Data field number (=field index+1) from which the data is copied
LastFieldNumber
Data field number (=field index+1) up to which the data are copied. A negative value counts from behind.
ReturnFieldName
Field name whose value is to be returned (e.g. auto number field).
DataToChange
data to be changed ... alternating: field name, field value - ParamArray: "Field1", Value1, "Field2", Value2, ....
Returns
Value from ReturnFieldName, or True/False if no ReturnFieldName was specified.
+
+
+
+
CopyRecords
+
Public Function CopyRecords(
ByVal Source
As
String,
ByVal StartFieldNumber
As
Long,
ByVal LastFieldNumber
As
Long,
ParamArray DataToChange()
As
Variant
) As Boolean
+
Recordset öffnen und Werte eines Datensatzes anfügen
Parameters
Source
Data source (table name or SQL statement)
StartFieldNumber
Data field number (=field index+1) from which the data is copied
LastFieldNumber
Data field number (=field index+1) up to which the data are copied. A negative value counts from behind.
DataToChange
data to be changed ... alternating: field name, field value - ParamArray: "Field1", Value1, "Field2", Value2, ....
Returns
Boolean
True if success
Remarks
Since a recordset is used for insertion, there is no data type check in the code -> watch out for implicit conversion.
+
+
+
+
CopyRecordsReturnFieldValue
+
Public Function CopyRecordsReturnFieldValue(
ByVal Source
As
String,
ByVal StartFieldNumber
As
Long,
ByVal LastFieldNumber
As
Long,
ByVal ReturnFieldName
As
String,
ParamArray DataToChange()
As
Variant
) As Variant
+
/** <summary> Datensätze kopieren und Werte ändern
Parameters
Source
Data source (table name or SQL statement)
StartFieldNumber
Data field number (=field index+1) from which the data is copied
LastFieldNumber
Data field number (=field index+1) up to which the data are copied. A negative value counts from behind.
ReturnFieldName
Field name whose value is to be returned (e.g. auto number field).
DataToChange
data to be changed ... alternating: field name, field value - ParamArray: "Field1", Value1, "Field2", Value2, ....
Returns
Value from ReturnFieldName, or True/False if no ReturnFieldName was specified.
Remarks
Since a recordset is used for insertion, there is no data type check in the code -> watch out for implicit conversion.
+
+
+
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/defDbConnection-Summary.js b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/defDbConnection-Summary.js
new file mode 100644
index 0000000..b932aba
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/defDbConnection-Summary.js
@@ -0,0 +1 @@
+NDFramePage.OnPageTitleLoaded("VisualBasicClass:data.defDbConnection","defDbConnection");NDSummary.OnSummaryLoaded("VisualBasicClass:data.defDbConnection",[["Visual Basic","VisualBasic"]],[["Classes","Class"],["Constants","Constant"],["Enums","Enumeration"],["Groups","Group"],["Types","Type"]],[[125,0,0,"data.defDbConnection"],[126,0,3,"Types","Types"],[127,0,4,"DbmsConnectionStrings","DbmsConnectionStrings"],[128,0,3,"Enums","Enums"],[129,0,2,"DbmsConnectionModes","DbmsConnectionModes"],[130,0,1,,"DMBS_DSNless"],[131,0,1,,"DMBS_DSN"],[132,0,1,,"DBMS_USERDEF"]]);
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/defDbConnection-SummaryToolTips.js b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/defDbConnection-SummaryToolTips.js
new file mode 100644
index 0000000..bd083ff
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/defDbConnection-SummaryToolTips.js
@@ -0,0 +1 @@
+NDSummary.OnToolTipsLoaded("VisualBasicClass:data.defDbConnection",{125:"
Set of global types, enums etc. for the DbConnection classes
",127:"
Type for the simultaneous transfer of the connection strings
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/defDbConnection-ToolTips.js b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/defDbConnection-ToolTips.js
new file mode 100644
index 0000000..eddcd48
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/defDbConnection-ToolTips.js
@@ -0,0 +1 @@
+NDContentPage.OnToolTipsLoaded({});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/defDbConnection.html b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/defDbConnection.html
new file mode 100644
index 0000000..431c936
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/defDbConnection.html
@@ -0,0 +1,34 @@
+
+
+defDbConnection
+
+
+
+
+
+
+
+
+
data.defDbConnection
+
Set of global types, enums etc. for the DbConnection classes
+
+
+
+
Types
+
+
+
+
DbmsConnectionStrings
+
Type for the simultaneous transfer of the connection strings
OledbConnectionString
OLEDB connectionstring for ADODB connection
OdbcConnectionString
ODBC connectionstring for DAO connection
DatabaseFile
Database file name incl. path if a file backend is used
+
+
+
+
Enums
+
+
+
+
DbmsConnectionModes
+
DMBS_DSNless
(1) without DSN
DMBS_DSN
(2) with DSN
DBMS_USERDEF
(128) User-defined connection strings
+
+
+
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/modDbConnection-Summary.js b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/modDbConnection-Summary.js
new file mode 100644
index 0000000..621e584
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/modDbConnection-Summary.js
@@ -0,0 +1 @@
+NDFramePage.OnPageTitleLoaded("VisualBasicClass:data.modDbConnection","modDbConnection");NDSummary.OnSummaryLoaded("VisualBasicClass:data.modDbConnection",[["Visual Basic","VisualBasic"]],[["Classes","Class"],["Functions","Function"],["Groups","Group"],["Properties","Property"]],[[116,0,0,"data.modDbConnection"],[117,0,2,"Factories","Factories"],[118,0,3,"DbCon","DbCon"],[119,0,3,"CurrentConnectionInfo","CurrentConnectionInfo"],[120,0,2,"Global Procedures","Global_Procedures"],[121,0,1,"CheckConnectionStatus","CheckConnectionStatus"],[122,0,1,"DisposeDbConnection","DisposeDbConnection"],[123,0,1,"TableDefExists","TableDefExists"],[124,0,1,"QueryDefExists","QueryDefExists"]]);
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/modDbConnection-SummaryToolTips.js b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/modDbConnection-SummaryToolTips.js
new file mode 100644
index 0000000..b69be5c
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/modDbConnection-SummaryToolTips.js
@@ -0,0 +1 @@
+NDSummary.OnToolTipsLoaded("VisualBasicClass:data.modDbConnection",{116:"
Collection of procedures for the DbConnectionManager class
",118:"
Access to DbConnection of the main DbConnectionManager instance
",119:"
Access to DbConnectionInfo of the main DbConnectionManager instance
",121:"
Public Function CheckConnectionStatus() As Boolean
Verbindung prüfen (call data.DbConnectionManager.CheckConnectionStatus)
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/modDbConnection-ToolTips.js b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/modDbConnection-ToolTips.js
new file mode 100644
index 0000000..f0523f6
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/modDbConnection-ToolTips.js
@@ -0,0 +1 @@
+NDContentPage.OnToolTipsLoaded({145:"
Public Function CheckConnectionStatus() As Boolean
Test whether a connection can be established
",150:"
Auxiliary class for setting the connection parameters
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/modDbConnection.html b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/modDbConnection.html
new file mode 100644
index 0000000..241410b
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/modDbConnection.html
@@ -0,0 +1,58 @@
+
+
+modDbConnection
+
+
+
+
+
+
+
+
+
data.modDbConnection
+
Collection of procedures for the DbConnectionManager class
Remarks
Used to instantiate DbConnectionManager and access the main elements of DbConnectionManager.</remarks>
+
+
+
+
Factories
+
+
+
+
DbCon
+
Access to DbConnection of the main DbConnectionManager instance
Returns
DbConnectionHandler
Remarks
Simplifies the call, as the writing of the DbConnectionManager instance variables is omitted. The first access creates the instance of the DbConnectionManager class if it does not already exist.
+
+
+
+
CurrentConnectionInfo
+
Access to DbConnectionInfo of the main DbConnectionManager instance
Simplifies the call, as the writing of the DbConnectionManager instance variables is omitted. The first access creates the instance of the DbConnectionManager class if it does not already exist.
+
+
+
+
Global Procedures
+
+
+
+
CheckConnectionStatus
+
Public Function CheckConnectionStatus() As Boolean
(DAO.Database) Database to use (optional: if nothing CurrentDb will be used)
+
+
+
+
QueryDefExists
+
Public Function QueryDefExists(
ByVal QueryDefName
As
String,
Optional ByVal db
As
DAO.Database
=
Nothing
) As Boolean
+
Check if QueryDef exists
Parameters
QueryDefName
(String) QueryDef name
db
(DAO.Database) Database to use (optional: if nothing CurrentDb will be used)
+
+
+
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/odbc/OdbcHandler-Summary.js b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/odbc/OdbcHandler-Summary.js
new file mode 100644
index 0000000..bdde96b
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/odbc/OdbcHandler-Summary.js
@@ -0,0 +1 @@
+NDFramePage.OnPageTitleLoaded("VisualBasicClass:data.odbc.OdbcHandler","OdbcHandler");NDSummary.OnSummaryLoaded("VisualBasicClass:data.odbc.OdbcHandler",[["Visual Basic","VisualBasic"]],[["Classes","Class"],["Events","Event"],["Functions","Function"],["Groups","Group"],["Properties","Property"]],[[45,0,0,"data.odbc.OdbcHandler"],[46,0,3,"Events","Events"],[47,0,1,"ErrorMissingCurrentDb","ErrorMissingCurrentDb"],[48,0,1,"ErrorEmptyConnectionString","ErrorEmptyConnectionString"],[49,0,1,"DbObjectRelinked","DbObjectRelinked"],[50,0,1,"DbObjectDeleted","DbObjectDeleted"],[51,0,1,"HookInsertIdentityReturn","HookInsertIdentityReturn"],[52,0,3,"Class control","Class_control"],[53,0,4,"HooksEnabled","HooksEnabled"],[54,0,3,"Data Connection","Data_Connection"],[55,0,4,"CurrentDb","CurrentDb"],[56,0,4,"CurrentDbBE","CurrentDbBE"],[57,0,4,"ConnectionString","ConnectionString"],[58,0,2,"OpenRecordset","OpenRecordset"],[59,0,2,"OpenRecordsetPT","OpenRecordsetPT"],[60,0,2,"Execute","Execute"],[61,0,2,"ExecutePT","ExecutePT"],[62,0,2,"LookupSQL","LookupSQL"],[63,0,2,"LookupSqlPT","LookupSqlPT"],[64,0,2,"Lookup","Lookup"],[65,0,2,"Count","Count"],[66,0,2,"Max","Max"],[67,0,2,"Min","Min"],[68,0,2,"Sum","Sum"],[69,0,2,"InsertIdentityReturn","InsertIdentityReturn"],[70,0,3,"Linked Table Support","Linked_Table_Support"],[71,0,2,"LinkTable","LinkTable"],[72,0,2,"RelinkTables","RelinkTables"],[73,0,2,"RelinkTable","RelinkTable"],[74,0,2,"RelinkPassThroughQueries","RelinkPassThroughQueries"],[75,0,2,"RelinkPassThroughQuery","RelinkPassThroughQuery"],[76,0,2,"RelinkTablesAndQueries","RelinkTablesAndQueries"],[77,0,2,"DeleteOdbcTableDefs","DeleteOdbcTableDefs"],[78,0,2,"IsLinkedTable","IsLinkedTable"],[79,0,2,"IsPassThroughQuery","IsPassThroughQuery"]]);
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/odbc/OdbcHandler-SummaryToolTips.js b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/odbc/OdbcHandler-SummaryToolTips.js
new file mode 100644
index 0000000..c6af507
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/odbc/OdbcHandler-SummaryToolTips.js
@@ -0,0 +1 @@
+NDSummary.OnToolTipsLoaded("VisualBasicClass:data.odbc.OdbcHandler",{45:"
ODBC data connection methods
",47:"
Event for missing CurrentDb reference
",48:"
Event for missing ODBC connection string
",49:"
Info about the last linked element
",50:"
Info about the last deleted element
",51:"
Event for missing OLEDB connection string
",53:"
Active Hooks
",55:"
DAO.Database-Instanz des Frontends bzw. jener Jet-DB in der die Pass-Through-Abfragen erstellt werden sollen
",56:"
Database-Referenz zum Backend
",57:"
ODBC Connection string
",58:"
Public Function OpenRecordset(
ByVal Source
As
String,
Optional ByVal RecordsetType
As
DAO.RecordsetTypeEnum
=
dbOpenForwardOnly,
Optional ByVal RecordsetOptions
As
DAO.RecordsetOptionEnum
=
DAO.RecordsetOptionEnum.dbSeeChanges,
Optional ByVal LockEdit
As
DAO.LockTypeEnum
=
DAO.LockTypeEnum.dbOptimistic
) As DAO.Recordset
Open DAO.Recordset
",59:"
Public Function OpenRecordsetPT(
ByVal Source
As
String,
Optional ByVal RecordsetType
As
DAO.RecordsetTypeEnum
=
dbOpenForwardOnly,
Optional ByVal RecordsetOptions
As
DAO.RecordsetOptionEnum
=
DAO.RecordsetOptionEnum.dbSeeChanges Or DAO.RecordsetOptionEnum.dbSQLPassThrough,
Optional ByVal LockEdit
As
DAO.LockTypeEnum
=
DAO.LockTypeEnum.dbOptimistic
) As DAO.Recordset
Open Pass Through DAO.Recordset
",60:"
Public Function Execute(
ByVal CommandText
As
String,
Optional ByVal Options
As
DAO.RecordsetOptionEnum
) As Long
Execute SQL statement (CurrentDbBE.Execute)
",61:"
Public Function ExecutePT(
ByVal CommandText
As
String,
Optional ByVal Options
As
DAO.RecordsetOptionEnum
=
DAO.RecordsetOptionEnum.dbSQLPassThrough
) As Long
Execute SQL statement with Pass Trough Query
",62:"
Public Function LookupSql(
ByVal SqlText
As
String,
Optional ByVal Index
As
Variant
=
0&,
Optional ByVal ValueIfNull
As
Variant
=
Null
) As Variant
Lookup DAO.Recordset replacement function for DLookup (passing a SQL statement) via CurrentDbBE
",63:"
Public Function LookupSqlPT(
ByVal SqlText
As
String,
Optional ByVal Index
As
Variant
=
0&,
Optional ByVal ValueIfNull
As
Variant
=
Null
) As Variant
Lookup DAO.Recordset replacement function for DLookup (passing a SQL statement) via Pass Through Query
",64:"
Public Function Lookup(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant,
Optional ByVal ValueIfNull
As
Variant
=
Null
) As Variant
DAO.Recordset replacement function for DLookup (via CurrentDbBE)
",65:"
Public Function Count(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
DAO.Recordset replacement function for DCount (via CurrentDbBE)
",66:"
Public Function Max(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
DAO.Recordset replacement function for DMax (via CurrentDbBE)
",67:"
Public Function Min(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
DAO.Recordset replacement function for DMin (via CurrentDbBE)
",68:"
Public Function Sum(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
DAO.Recordset replacement function for DSum (via CurrentDbBE)
",69:"
Public Function InsertIdentityReturn(
ByVal InsertSql
As
String
) As Variant
Execute insert SQL statement and return last identity value (via CurrentDbBE)
",71:"
Public Sub LinkTable(
ByVal SourceTableName
As
String,
Optional ByVal LinkedTableName
As
String
=
vbNullString,
Optional ByVal SavePWD
As
Boolean
=
False,
Optional ByVal RemoveSchemaName
As
Boolean
=
True
)
Link backend table in Access frontend
",72:"
Public Function RelinkTables(
Optional ByVal SavePWD
As
Boolean
=
False,
Optional ByVal EventPeriod
As
Long
=
0
) As Long
Relink existing tables
",73:"
Public Function RelinkTable(
ByVal LinkedTableName
As
String,
Optional ByVal SavePWD
As
Boolean
=
False
) As Boolean
Relink linked table with possible change of server data
",74:"
Public Function RelinkPassThroughQueries(
Optional ByVal SavePWD
As
Boolean
=
False,
Optional ByVal EventPeriod
As
Long
=
0
) As Long
Alle Pass-Through-Abfragen neu verknüpfen
",75:"
Public Function RelinkPassThroughQuery(
ByVal QueryName
As
String,
Optional ByVal SavePWD
As
Boolean
=
False
) As Boolean
Relink pass through query
",76:"
Public Function RelinkTablesAndQueries(
Optional ByVal SavePWD
As
Boolean
=
False,
Optional ByVal EventPeriod
As
Long
=
0
) As Long
Relink all linked tables and pass-through queries
",77:"
Public Function DeleteOdbcTableDefs(
Optional ByVal EventPeriod
As
Long
=
0
) As Long
Delete all linked table in the frontend. (Has no effect on the backend tables).
",78:"
Public Function IsLinkedTable(
ByVal TableToCheck
As
DAO.TableDef
) As Boolean
Check if TableDef is a linked table
",79:"
Public Function IsPassThroughQuery(
ByVal QueryToCheck
As
DAO.QueryDef
) As Boolean
Check if QueryDef is a pass through query
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/odbc/OdbcHandler-ToolTips.js b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/odbc/OdbcHandler-ToolTips.js
new file mode 100644
index 0000000..c68a69e
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/odbc/OdbcHandler-ToolTips.js
@@ -0,0 +1 @@
+NDContentPage.OnToolTipsLoaded({56:"
Database-Referenz zum Backend
",57:"
ODBC Connection string
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/odbc/OdbcHandler.html b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/odbc/OdbcHandler.html
new file mode 100644
index 0000000..65052fa
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/odbc/OdbcHandler.html
@@ -0,0 +1,203 @@
+
+
+OdbcHandler
+
+
+
+
+
+
+
+
+
data.odbc.OdbcHandler
+
ODBC data connection methods
Author
Josef Poetzl
+
+
+
+
Events
+
+
+
+
ErrorMissingCurrentDb
+
Event for missing CurrentDb reference
Parameters
Msg
Message about the cause of the event triggering. (Not yet used)
NewCurrentDbRef
DAO.Database reference to be used for CurrentDb
Remarks
The required DAO.Database reference can be passed on via the ByRef parameter NewCurrentDbRef.
+
+
+
+
ErrorEmptyConnectionString
+
Event for missing ODBC connection string
Parameters
Msg
Message about the cause of the event triggering. (Not yet used)
NewConnectionString
ODBC Connectionstring
Remarks
The appropriate ODBC connection string can be passed on via the ByRef parameter NewConnectionString.
+
+
+
+
DbObjectRelinked
+
Info about the last linked element
Parameters
LastDbObjectName
the last linked table or view
Counter
Number of linked elements since the method was called
Remarks
Used in the RelinkTablesAndQueries method.
+
+
+
+
DbObjectDeleted
+
Info about the last deleted element
Parameters
LastDbObjectName
the last deleted table or view
Counter
Number of deleted elements since the method was called
Remarks
Used in the RelinkTablesAndQueries method.
+
+
+
+
HookInsertIdentityReturn
+
Event for missing OLEDB connection string
Parameters
InsertSql
SQL text of insert statement
ActiveDb
ADODB Connection to use
IdentitySelectString
Input string to use
HookResponseMode
resume action after event call: 0 ... code resume after event, 1 exit function after event
HookResponseMessage
return value of function (e.g. InsertIdentityReturn) when HookResponseMode <> 0
Remarks
New values can be passed on via the ByRef parameters.
+
+
+
+
Class control
+
+
+
+
HooksEnabled
+
Active Hooks
Remarks
Used in InsertIdentityReturn
+
+
+
+
Data Connection
+
+
+
+
CurrentDb
+
DAO.Database-Instanz des Frontends bzw. jener Jet-DB in der die Pass-Through-Abfragen erstellt werden sollen
+
+
+
+
CurrentDbBE
+
Database-Referenz zum Backend
Remarks DAO.Database wird über DBEngine.OpenDatabase("", dbDriverComplete, False, ConnectionString) geöffnet.
Lookup DAO.Recordset replacement function for DLookup (passing a SQL statement) via CurrentDbBE
Parameters
SqlText
SQL statement
Index
Field selection if the first field of the recordset is not to be returned. The index is passed in the same way as ADODB.Recordset.Fields(index).
ValueIfNull
Return value if record is missing or data field value is Null (default: Null).
Returns
Variant
Null, if SQL statement does not return a record.
Remarks
The SQL statement must be written in the Jet/ACE SQL dialect.
+
+
+
+
LookupSqlPT
+
Public Function LookupSqlPT(
ByVal SqlText
As
String,
Optional ByVal Index
As
Variant
=
0&,
Optional ByVal ValueIfNull
As
Variant
=
Null
) As Variant
+
Lookup DAO.Recordset replacement function for DLookup (passing a SQL statement) via Pass Through Query
Parameters
SqlText
SQL statement
Index
Field selection if the first field of the recordset is not to be returned. The index is passed in the same way as ADODB.Recordset.Fields(index).
ValueIfNull
Return value if record is missing or data field value is Null (default: Null).
Returns
Variant
Null, if SQL statement does not return a record.
Remarks
The SQL statement must be written in the SQL dialect of backend (e. g. T-SQL for SQL-Server)
+
+
+
+
Lookup
+
Public Function Lookup(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant,
Optional ByVal ValueIfNull
As
Variant
=
Null
) As Variant
+
DAO.Recordset replacement function for DLookup (via CurrentDbBE)
Parameters
Expr
Field name or calculated expression (select part)
Domain
Table, query or SQL expression for sub-query (FROM part)
Criteria
(Optional) Criteria string (WHERE part)
ValueIfNull
Return value if record is missing or data field value is Null (default: Null).
Returns
Variant
+
+
+
+
Count
+
Public Function Count(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
+
DAO.Recordset replacement function for DCount (via CurrentDbBE)
Parameters
Expr
Field name or calculated expression (select part)
Domain
Table, query or SQL expression for sub-query (FROM part)
Criteria
(optional) Criteria string (WHERE part)
Returns
Long
+
+
+
+
Max
+
Public Function Max(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
+
DAO.Recordset replacement function for DMax (via CurrentDbBE)
Parameters
Expr
Field name or calculated expression (select part)
Domain
Table, query or SQL expression for sub-query (FROM part)
Criteria
(Optional) Criteria string (WHERE part)
Returns
Variant
+
+
+
+
Min
+
Public Function Min(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
+
DAO.Recordset replacement function for DMin (via CurrentDbBE)
Parameters
Expr
Field name or calculated expression (select part)
Domain
Table, query or SQL expression for sub-query (FROM part)
Criteria
(Optional) Criteria string (WHERE part)
Returns
Variant
+
+
+
+
Sum
+
Public Function Sum(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
+
DAO.Recordset replacement function for DSum (via CurrentDbBE)
Parameters
Expr
Field name or calculated expression (select part)
Domain
Table, query or SQL expression for sub-query (FROM part)
Criteria
(Optional) Criteria string (WHERE part)
Returns
Variant
+
+
+
+
InsertIdentityReturn
+
Public Function InsertIdentityReturn(
ByVal InsertSql
As
String
) As Variant
+
Execute insert SQL statement and return last identity value (via CurrentDbBE)
Parameters
InsertSQL
Insert SQL statement
Returns
Identity value or NULL if no record was appended
Remarks
Works for Jet only from Jet 4.0 (Access 2000), IdentityTable is only applicable for MSSQL, under MySQL the IDENT_CURRENT function does not exist. If HooksEnabled: event HookInsertIdentityReturn will be raised
+
+
+
+
Linked Table Support
+
+
+
+
LinkTable
+
Public Sub LinkTable(
ByVal SourceTableName
As
String,
Optional ByVal LinkedTableName
As
String
=
vbNullString,
Optional ByVal SavePWD
As
Boolean
=
False,
Optional ByVal RemoveSchemaName
As
Boolean
=
True
)
+
Link backend table in Access frontend
Parameters
SourceTableName
Table or view in the backend
LinkedTableName
Table in frontend
SavePWD
Save ODBC password in linked table
RemoveSchemaName
Remove schema identifier
Remarks
If there is a 2-part table identifier like "dbo.Table123" in the BE and bRemoveSchemaName is set to false, the dot is replaced by "_".
+
+
+
+
RelinkTables
+
Public Function RelinkTables(
Optional ByVal SavePWD
As
Boolean
=
False,
Optional ByVal EventPeriod
As
Long
=
0
) As Long
+
Relink existing tables
Parameters
SavePWD
Save ODBC password in linked table
EventPeriod
Number of linked elements when the DbObjectRelinked event is to be called. (Default: 0 ... no event call).
Returns
Long
Number of linked tables
+
+
+
+
RelinkTable
+
Public Function RelinkTable(
ByVal LinkedTableName
As
String,
Optional ByVal SavePWD
As
Boolean
=
False
) As Boolean
+
Relink linked table with possible change of server data
Parameters
LinkedTableName
Table in frontend
SavePWD
Save ODBC password in linked table
Returns
Boolean
success
Remarks
The TableDef property SourceTableName is not changed.
+
+
+
+
RelinkPassThroughQueries
+
Public Function RelinkPassThroughQueries(
Optional ByVal SavePWD
As
Boolean
=
False,
Optional ByVal EventPeriod
As
Long
=
0
) As Long
+
Alle Pass-Through-Abfragen neu verknüpfen
Parameters
SavePWD
Save ODBC password in linked table
EventPeriod
Number of linked elements when the DbObjectRelinked event is to be called. (Default: 0 ... no event call).
Returns
Long
Number of linked pass through queries
+
+
+
+
RelinkPassThroughQuery
+
Public Function RelinkPassThroughQuery(
ByVal QueryName
As
String,
Optional ByVal SavePWD
As
Boolean
=
False
) As Boolean
+
Relink pass through query
Parameters
QueryName
Table in frontend
SavePWD
Save ODBC password in pass throug query
Returns
Boolean
success
+
+
+
+
RelinkTablesAndQueries
+
Public Function RelinkTablesAndQueries(
Optional ByVal SavePWD
As
Boolean
=
False,
Optional ByVal EventPeriod
As
Long
=
0
) As Long
+
Relink all linked tables and pass-through queries
Parameters
SavePWD
Save ODBC password in linked table
EventPeriod
Number of linked elements when the DbObjectRelinked event is to be called. (Default: 0 ... no event call).
Returns
Long
Number of linked tables and queries
+
+
+
+
DeleteOdbcTableDefs
+
Public Function DeleteOdbcTableDefs(
Optional ByVal EventPeriod
As
Long
=
0
) As Long
+
Delete all linked table in the frontend. (Has no effect on the backend tables).
Parameters
EventPeriod
Number of linked elements when the DbObjectRelinked event is to be called. (Default: 0 ... no event call).
Returns
Long
Number of deleted tables
Remarks
Depending on the setting of EventPeriod the event DbObjectDeleted is triggered
+
+
+
+
IsLinkedTable
+
Public Function IsLinkedTable(
ByVal TableToCheck
As
DAO.TableDef
) As Boolean
+
Check if TableDef is a linked table
Parameters
TableToCheck
TableDef reference to Access table in frontend
Returns
Boolean
+
+
+
+
IsPassThroughQuery
+
Public Function IsPassThroughQuery(
ByVal QueryToCheck
As
DAO.QueryDef
) As Boolean
+
Check if QueryDef is a pass through query
Parameters
QueryToCheck
QueryDef reference to Access query in frontend
Returns
Boolean
+
+
+
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/sql/SqlTools-Summary.js b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/sql/SqlTools-Summary.js
new file mode 100644
index 0000000..9d89cd4
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/sql/SqlTools-Summary.js
@@ -0,0 +1 @@
+NDFramePage.OnPageTitleLoaded("VisualBasicClass:data.sql.SqlTools","SqlTools");NDSummary.OnSummaryLoaded("VisualBasicClass:data.sql.SqlTools",[["Visual Basic","VisualBasic"]],[["Classes","Class"],["Functions","Function"],["Groups","Group"],["Properties","Property"]],[[1,0,0,"data.sql.SqlTools"],[2,0,2,"Class support","Class_support"],[3,0,1,"Clone","Clone"],[4,0,1,"NewInstance","NewInstance"],[5,0,2,"SQL dialect preferences","SQL_dialect_preferences"],[6,0,3,"DAO","DAO"],[7,0,3,"TSql","TSql"],[8,0,3,"SqlWildCardString","SqlWildCardString"],[9,0,3,"SqlDateFormat","SqlDateFormat"],[10,0,3,"SqlBooleanTrueString","SqlBooleanTrueString"],[11,0,2,"BuildCriteria","BuildCriteria"],[12,0,1,"BuildCriteria","BuildCriteria(2)"],[13,0,2,"Convert to SQL","Convert_to_SQL"],[14,0,1,"ConvertToSqlText","ConvertToSqlText"],[15,0,1,"TextToSqlText","TextToSqlText"],[16,0,1,"DateToSqlText","DateToSqlText"],[17,0,1,"NumberToSqlText","NumberToSqlText"],[18,0,1,"BooleanToSqlText","BooleanToSqlText"]]);
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/sql/SqlTools-SummaryToolTips.js b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/sql/SqlTools-SummaryToolTips.js
new file mode 100644
index 0000000..8cb68b6
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/sql/SqlTools-SummaryToolTips.js
@@ -0,0 +1 @@
+NDSummary.OnToolTipsLoaded("VisualBasicClass:data.sql.SqlTools",{1:"
Functions to build sql strings
",3:"
Public Function Clone(
Optional ByVal NewSqlDateFormat
As
String
=
SQL_DEFAULT_DATEFORMAT,
Optional ByVal NewSqlBooleanTrueString
As
String
=
SQL_DEFAULT_BOOLTRUESTRING,
Optional ByVal NewSqlWildCardString
As
String
=
SQL_DEFAULT_WILDCARD
) As SqlTools
Create a new instance with basic settings of the current instance.
",4:"
Public Function NewInstance(
ByVal NewSqlDateFormat
As
String,
ByVal NewSqlBooleanTrueString
As
String,
ByVal NewSqlWildCardString
As
String
) As SqlTools
Create a new instance
",6:"
SqlTools instance configured for DAO-SQL (Jet/ACE)
",7:"
SqlTools instance configured for T-SQL
",8:"
Wildcard character for like
",9:"
Format for date values
",10:"
Boolean string in SQL statement
",12:"
Public Function BuildCriteria(
ByVal FieldName
As
String,
ByVal FieldDataType
As
SqlFieldDataType,
ByVal RelationalOperator
As
SqlRelationalOperators,
ByVal FilterValue
As
Variant,
Optional ByVal FilterValue2
As
Variant
=
Null,
Optional ByVal IgnoreValue
As
Variant,
Optional ByVal DisableIgnoreNullValue
As
Boolean
=
False
) As String
Create SQL criteria string
",14:"
Public Function ConvertToSqlText(
ByVal Value
As
Variant,
ByVal FieldDataType
As
SqlFieldDataType
) As String
Convert values to string for SQL statement assembled by VBA.
",15:"
Public Function TextToSqlText(
ByVal Value
As
Variant,
Optional ByVal Delimiter
As
String
=
SQL_DEFAULT_TEXTDELIMITER,
Optional ByVal WithoutLeftRightDelim
As
Boolean
=
False
) As String
Prepare text for SQL statement
",16:"
Public Function DateToSqlText(
ByVal Value
As
Variant,
Optional ByVal FormatString
As
String
=
SQL_DEFAULT_DATEFORMAT
) As String
Convert date value to string for SQL statement assembled by VBA.
",17:"
Public Function NumberToSqlText(
ByVal Value
As
Variant
) As String
Convert numeric value to string for SQL statement assembled by VBA.
",18:"
Public Function BooleanToSqlText(
ByVal Value
As
Variant,
Optional ByVal TrueString
As
String
=
SQL_DEFAULT_BOOLTRUESTRING
) As String
Prepare Boolean for SQL text
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/sql/SqlTools-ToolTips.js b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/sql/SqlTools-ToolTips.js
new file mode 100644
index 0000000..eddcd48
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/sql/SqlTools-ToolTips.js
@@ -0,0 +1 @@
+NDContentPage.OnToolTipsLoaded({});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/sql/SqlTools.html b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/sql/SqlTools.html
new file mode 100644
index 0000000..10c6ebd
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/classes/VisualBasic/data/sql/SqlTools.html
@@ -0,0 +1,105 @@
+
+
+SqlTools
+
+
+
+
+
+
+
+
+
data.sql.SqlTools
+
Functions to build sql strings
Author
Josef Poetzl
Remarks
"Attribute VB_PredeclaredId = True" to enable using SqlTools without explicit instantiation.
Warning
Don't forget to set parameters for date format, boolean and wildcard for the DBMS.
+
+
+
+
Class support
+
+
+
+
Clone
+
Public Function Clone(
Optional ByVal NewSqlDateFormat
As
String
=
SQL_DEFAULT_DATEFORMAT,
Optional ByVal NewSqlBooleanTrueString
As
String
=
SQL_DEFAULT_BOOLTRUESTRING,
Optional ByVal NewSqlWildCardString
As
String
=
SQL_DEFAULT_WILDCARD
) As SqlTools
+
Create a new instance with basic settings of the current instance.
Parameters
NewSqlDateFormat
use this date format instead of base instance
NewSqlBooleanTrueString
use this text for true instead of base instance
NewSqlWildCardString
use this wildcard string instead of base instance
Returns
SqlTools instance with config form base
See Also
NewInstance
+
+
+
+
NewInstance
+
Public Function NewInstance(
ByVal NewSqlDateFormat
As
String,
ByVal NewSqlBooleanTrueString
As
String,
ByVal NewSqlWildCardString
As
String
) As SqlTools
+
Create a new instance
+
+
+
+
SQL dialect preferences
+
+
+
+
DAO
+
SqlTools instance configured for DAO-SQL (Jet/ACE)
+
+
+
+
TSql
+
SqlTools instance configured for T-SQL
+
+
+
+
SqlWildCardString
+
Wildcard character for like
+
+
+
+
SqlDateFormat
+
Format for date values
+
+
+
+
SqlBooleanTrueString
+
Boolean string in SQL statement
+
+
+
+
BuildCriteria
+
+
+
+
BuildCriteria
+
Public Function BuildCriteria(
ByVal FieldName
As
String,
ByVal FieldDataType
As
SqlFieldDataType,
ByVal RelationalOperator
As
SqlRelationalOperators,
ByVal FilterValue
As
Variant,
Optional ByVal FilterValue2
As
Variant
=
Null,
Optional ByVal IgnoreValue
As
Variant,
Optional ByVal DisableIgnoreNullValue
As
Boolean
=
False
) As String
+
Create SQL criteria string
Parameters
FieldName
Field name in the data source to be filtered
RelationalOperator
Relational operator (=, <=, etc.)
FilterValue
Filter value (can be a single value or an array of values)
FilterValue2
Optional 2nd filter value (for Between)
IgnoreValue
The value for which no filter condition is to be created. (Array transfer of values possible)
Returns
SQL criteria string
+
+
+
+
Convert to SQL
+
+
+
+
ConvertToSqlText
+
Public Function ConvertToSqlText(
ByVal Value
As
Variant,
ByVal FieldDataType
As
SqlFieldDataType
) As String
+
Convert values to string for SQL statement assembled by VBA.
Parameters
Value
Value to convert
FieldDataType
Data type of the value to be converted
Returns
String
SQL conform string
+
+
+
+
TextToSqlText
+
Public Function TextToSqlText(
ByVal Value
As
Variant,
Optional ByVal Delimiter
As
String
=
SQL_DEFAULT_TEXTDELIMITER,
Optional ByVal WithoutLeftRightDelim
As
Boolean
=
False
) As String
+
Prepare text for SQL statement
Parameters
Value
Value to convert
Delimiter
Delimiter for text values. (In most DBMS ' is used as a delimiter).
WithoutLeftRightDelim
Only double the boundary drawing within the values, but do not set the boundary.
Returns
String
Example
strSQL = "select ... from tabelle where Feld = " & TextToSqlText("ab'cd") => strSQL = "select ... from tabelle where Feld = 'ab''cd'"
+
+
+
+
DateToSqlText
+
Public Function DateToSqlText(
ByVal Value
As
Variant,
Optional ByVal FormatString
As
String
=
SQL_DEFAULT_DATEFORMAT
) As String
+
Convert date value to string for SQL statement assembled by VBA.
Parameters
Value
Value to convert
FormatString
Date format (depends on DBMS!)
Returns
String
+
+
+
+
NumberToSqlText
+
Public Function NumberToSqlText(
ByVal Value
As
Variant
) As String
+
Convert numeric value to string for SQL statement assembled by VBA.
Parameters
Value
Value to convert
FormatString
Date format (depends on DBMS!)
Returns
String
Remarks
Str function ensures ".".
+
+
+
+
BooleanToSqlText
+
Public Function BooleanToSqlText(
ByVal Value
As
Variant,
Optional ByVal TrueString
As
String
=
SQL_DEFAULT_BOOLTRUESTRING
) As String
+
Prepare Boolean for SQL text
Parameters
Value
Value to convert
TrueString
String for true value (optional)
Returns
String
+
+
+
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/DbConnectionHandler-cls-Summary.js b/doc/ACLib-DbConnection-Framework/files/DbConnectionHandler-cls-Summary.js
new file mode 100644
index 0000000..1d2b39d
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/DbConnectionHandler-cls-Summary.js
@@ -0,0 +1 @@
+NDFramePage.OnPageTitleLoaded("File:DbConnectionHandler.cls","DbConnectionHandler.cls");NDSummary.OnSummaryLoaded("File:DbConnectionHandler.cls",[["Visual Basic","VisualBasic"]],[["Classes","Class"],["Events","Event"],["Functions","Function"],["Groups","Group"],["Properties","Property"]],[[184,0,0,"data.DbConnectionHandler","data.DbConnectionHandler"],[185,0,3,"Events","data.DbConnectionHandler.Events"],[186,0,1,"ErrorMissingCurrentDb","data.DbConnectionHandler.ErrorMissingCurrentDb"],[187,0,1,"ErrorMissingCurrentConnection","data.DbConnectionHandler.ErrorMissingCurrentConnection"],[188,0,1,"ErrorEmptyOledbConnectionString","data.DbConnectionHandler.ErrorEmptyOledbConnectionString"],[189,0,1,"ErrorEmptyOdbcConnectionString","data.DbConnectionHandler.ErrorEmptyOdbcConnectionString"],[190,0,1,"Disposed","data.DbConnectionHandler.Disposed"],[191,0,3,"Dispose support","data.DbConnectionHandler.Dispose_support"],[192,0,2,"Dispose","data.DbConnectionHandler.Dispose"],[193,0,3,"DAO data connection","data.DbConnectionHandler.DAO_data_connection"],[194,0,4,"DAO","data.DbConnectionHandler.DAO"],[195,0,4,"CurrentDb","data.DbConnectionHandler.CurrentDb"],[196,0,3,"ADODB data connection","data.DbConnectionHandler.ADODB_data_connection"],[197,0,4,"ADODB","data.DbConnectionHandler.ADODB"],[198,0,4,"CurrentConnection","data.DbConnectionHandler.CurrentConnection"],[199,0,4,"OledbConnectionString","data.DbConnectionHandler.OledbConnectionString"],[200,0,3,"ODBC data connection","data.DbConnectionHandler.ODBC_data_connection"],[201,0,4,"ODBC","data.DbConnectionHandler.ODBC"],[202,0,4,"OdbcConnectionString","data.DbConnectionHandler.OdbcConnectionString"],[203,0,4,"CurrentDbBE","data.DbConnectionHandler.CurrentDbBE"]]);
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/DbConnectionHandler-cls-SummaryToolTips.js b/doc/ACLib-DbConnection-Framework/files/DbConnectionHandler-cls-SummaryToolTips.js
new file mode 100644
index 0000000..0754889
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/DbConnectionHandler-cls-SummaryToolTips.js
@@ -0,0 +1 @@
+NDSummary.OnToolTipsLoaded("File:DbConnectionHandler.cls",{184:"
Database connection via ADODB or DAO (incl. ODBC)
",185:"
Error events for possible error handling via the frontend application
",186:"
Event for missing CurrentDb reference (Passing the data.dao.DaoHandler or data.odbc.OdbcHandler event: ErrorMissingCurrentDb)
",187:"
Event for missing ADODB connection reference (Passing the AdodbHandler event: data.adodb.AdodbHandler::ErrorMissingCurrentConnection)
",188:"
Event for missing OLEDB connection string (Passing the AdodbHandler event: data.adodb.AdodbHandler::ErrorEmptyOledbConnectionString )
",189:"
Event for missing ODBC connection string (Passing the OdbcHandler event: data.odbc.OdbcHandler::ErrorEmptyConnectionString)
",190:"
Event message when object references have been removed
",192:"
Public Sub Dispose()
Remove object references
",193:"
DAO access methods
",194:"
Instance of data.dao.DaoHandler
",195:"
CurrentDb = data.dao.DaoHandler::CurrentDb
",196:"
ADODB access methods
",197:"
Instance of data.adodb.AdodbHandler
",198:"
ADODB connection to the current DBMS connection = data.adodb.AdodbHandler::CurrentConnection
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/DbConnectionHandler-cls-ToolTips.js b/doc/ACLib-DbConnection-Framework/files/DbConnectionHandler-cls-ToolTips.js
new file mode 100644
index 0000000..a977435
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/DbConnectionHandler-cls-ToolTips.js
@@ -0,0 +1 @@
+NDContentPage.OnToolTipsLoaded({19:"
ADODB data connection methods
",21:"
Event for missing ADODB connection reference (Passing the AdodbHandler event: data.adodb.AdodbHandler::ErrorMissingCurrentConnection)
",22:"
Event for missing OLEDB connection string
",27:"
Currently set ADODB connection
",28:"
OLEDB connection string
",45:"
ODBC data connection methods
",48:"
Event for missing ODBC connection string
",56:"
Database-Referenz zum Backend
",57:"
ODBC Connection string
",80:"
DAO data connection methods
",87:"
CurrentDbC variant
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/DbConnectionHandler-cls.html b/doc/ACLib-DbConnection-Framework/files/DbConnectionHandler-cls.html
new file mode 100644
index 0000000..62bc5d1
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/DbConnectionHandler-cls.html
@@ -0,0 +1,111 @@
+
+
+DbConnectionHandler.cls
+
+
+
+
+
+
+
+
+
data.DbConnectionHandler
+
Database connection via ADODB or DAO (incl. ODBC)
Standardises ADO and DAO methods
Author
Josef Poetzl
+
+
+
+
Events
+
Error events for possible error handling via the frontend application
+
+
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/DbConnectionInfo-cls-Summary.js b/doc/ACLib-DbConnection-Framework/files/DbConnectionInfo-cls-Summary.js
new file mode 100644
index 0000000..791e1b5
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/DbConnectionInfo-cls-Summary.js
@@ -0,0 +1 @@
+NDFramePage.OnPageTitleLoaded("File:DbConnectionInfo.cls","DbConnectionInfo.cls");NDSummary.OnSummaryLoaded("File:DbConnectionInfo.cls",[["Visual Basic","VisualBasic"]],[["Classes","Class"],["Events","Event"],["Functions","Function"],["Groups","Group"],["Properties","Property"]],[[150,0,0,"data.DbConnectionInfo","data.DbConnectionInfo"],[151,0,3,"Events","data.DbConnectionInfo.Events"],[152,0,1,"DbmsConnectionChanged","data.DbConnectionInfo.DbmsConnectionChanged"],[153,0,1,"DbmsConnectionInfoCleared","data.DbConnectionInfo.DbmsConnectionInfoCleared"],[154,0,1,"DbmsInfoMessage","data.DbConnectionInfo.DbmsInfoMessage"],[155,0,1,"PasswordChanged","data.DbConnectionInfo.PasswordChanged"],[156,0,1,"Disposed","data.DbConnectionInfo.Disposed"],[157,0,3,"DBMS Connection Parameters","data.DbConnectionInfo.DBMS_Connection_Parameters"],[158,0,4,"ConnectionIdentifier","data.DbConnectionInfo.ConnectionIdentifier"],[159,0,4,"DbmsName","data.DbConnectionInfo.DbmsName"],[160,0,4,"DbServer","data.DbConnectionInfo.DbServer"],[161,0,4,"DbName","data.DbConnectionInfo.DbName"],[162,0,4,"DatabaseFile","data.DbConnectionInfo.DatabaseFile"],[163,0,4,"UseLoginForm","data.DbConnectionInfo.UseLoginForm"],[164,0,4,"LoginForm","data.DbConnectionInfo.LoginForm"],[165,0,4,"DbUser","data.DbConnectionInfo.DbUser"],[166,0,4,"DbUserPassword","data.DbConnectionInfo.DbUserPassword"],[167,0,4,"SavePassword","data.DbConnectionInfo.SavePassword"],[168,0,3,"DBMS Connection","data.DbConnectionInfo.DBMS_Connection"],[169,0,4,"ConnectionStrings","data.DbConnectionInfo.ConnectionStrings"],[170,0,4,"OledbConnectionString","data.DbConnectionInfo.OledbConnectionString"],[171,0,4,"OdbcConnectionString","data.DbConnectionInfo.OdbcConnectionString"],[172,0,2,"CheckConnection","data.DbConnectionInfo.CheckConnection"],[173,0,2,"ClearConnectionInfo","data.DbConnectionInfo.ClearConnectionInfo"],[174,0,2,"ChangeDbUserPassword","data.DbConnectionInfo.ChangeDbUserPassword"],[175,0,3,"DMBS specific","data.DbConnectionInfo.DMBS_specific"],[176,0,4,"PermanentBackendRstSqlText","data.DbConnectionInfo.PermanentBackendRstSqlText"],[177,0,4,"TableListSqlText","data.DbConnectionInfo.TableListSqlText"],[178,0,2,"ParseTableName","data.DbConnectionInfo.ParseTableName"],[179,0,4,"DateFormat","data.DbConnectionInfo.DateFormat"],[180,0,4,"WildCardString","data.DbConnectionInfo.WildCardString"],[181,0,4,"BooleanTrueString","data.DbConnectionInfo.BooleanTrueString"],[182,0,4,"LoginFormName","data.DbConnectionInfo.LoginFormName"],[183,0,4,"DbmsConfigFormName","data.DbConnectionInfo.DbmsConfigFormName"]]);
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/DbConnectionInfo-cls-SummaryToolTips.js b/doc/ACLib-DbConnection-Framework/files/DbConnectionInfo-cls-SummaryToolTips.js
new file mode 100644
index 0000000..457d203
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/DbConnectionInfo-cls-SummaryToolTips.js
@@ -0,0 +1 @@
+NDSummary.OnToolTipsLoaded("File:DbConnectionInfo.cls",{150:"
Auxiliary class for setting the connection parameters
",152:"
Event when the connection changes
",153:"
Event raised when the connection parameters have been reset
",154:"
Information sharing event
",155:"
Event raised when the password has been changed
",156:"
Event raised when disposed
",159:"
Name of DBMS (MSJET, MSSQL, MySQL, ORACLE, ODBC)
",160:"
Name of Database Server
",161:"
Name of Database
",162:"
File name incl. path of a file-based backend
",163:"
Setting from the connection parameters whether to use the login form when logging in.
",164:"
Form reference to LoginForm
",165:"
Name des Datenbankbenutzers
",166:"
Password of the database user
",167:"
Setting from the connection parameters whether password should be saved for linked tables
",169:"
ODBC and OLEDB Connectionstring
",170:"
OledbConnectionString
",171:"
OdbcConnectionString
",172:"
Public Function CheckConnection(
Optional ByRef ErrMsg
As
String
=
vbNullString
) As Boolean
Check connection to server and database
",173:"
Public Sub ClearConnectionInfo()
Delete set connection parameters
",174:"
Public Function ChangeDbUserPassword(
ByVal NewPassword
As
String,
ByVal OldPassword
As
String,
Optional ByVal LoginName
As
String
=
vbNullString,
Optional ByRef Msg
As
String
) As Boolean
Datenbankpasswort des Benutzers ändern
",176:"
Select statement for ODBC recordset connection to maintain connection
",177:"
SQL-Anweisung im SQL-Dialtekt des DBMS zur Auflistung der im DBS enthaltenen Tabellen
",178:"
Public Function ParseTableName(
ByVal TableName
As
String
) As String
Auxiliary procedure for adjusting the table name
",179:"
DBMS specific date format
",180:"
DBMS specific wildcard (like *)
",181:"
DBMS specific string for true
",182:"
Name of the login form
",183:"
Name of the DBMS configuration form
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/DbConnectionInfo-cls-ToolTips.js b/doc/ACLib-DbConnection-Framework/files/DbConnectionInfo-cls-ToolTips.js
new file mode 100644
index 0000000..e4d5c38
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/DbConnectionInfo-cls-ToolTips.js
@@ -0,0 +1 @@
+NDContentPage.OnToolTipsLoaded({127:"
Type for the simultaneous transfer of the connection strings
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/DbConnectionInfo-cls.html b/doc/ACLib-DbConnection-Framework/files/DbConnectionInfo-cls.html
new file mode 100644
index 0000000..47d1682
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/DbConnectionInfo-cls.html
@@ -0,0 +1,181 @@
+
+
+DbConnectionInfo.cls
+
+
+
+
+
+
+
+
+
data.DbConnectionInfo
+
Auxiliary class for setting the connection parameters
Author
Josef Poetzl
Remarks
Uses table usys_DbmsConnection (create table with DBMS Connection Wizard)
+
+
+
+
Events
+
+
+
+
DbmsConnectionChanged
+
Event when the connection changes
Parameters
NewConnectionIdentifier
new used connection identifier (from table data field CID)
Remarks
Can be useful if displays are updated depending on the connection, etc.
+
+
+
+
DbmsConnectionInfoCleared
+
Event raised when the connection parameters have been reset
+
+
+
+
DbmsInfoMessage
+
Information sharing event
Parameters
Source
Source of the message
Msg
Message
MsgStyle
VbMsgBoxStyle
Remarks
Used to pass on info (similar to debug.print)
+
+
+
+
PasswordChanged
+
Event raised when the password has been changed
+
+
+
+
Disposed
+
Event raised when disposed
+
+
+
+
DBMS Connection Parameters
+
+
+
+
ConnectionIdentifier
+
Connection identifier
value from data field CID
+
+
+
+
DbmsName
+
Name of DBMS (MSJET, MSSQL, MySQL, ORACLE, ODBC)
+
+
+
+
DbServer
+
Name of Database Server
Remarks
Incl. instance of SQL Server & co.
+
+
+
+
DbName
+
Name of Database
+
+
+
+
DatabaseFile
+
File name incl. path of a file-based backend
+
+
+
+
UseLoginForm
+
Setting from the connection parameters whether to use the login form when logging in.
+
+
+
+
LoginForm
+
Form reference to LoginForm
+
+
+
+
DbUser
+
Name des Datenbankbenutzers
Parameters
WithoutServerCheck
True = Do not check whether connection data has already been read in.
+
+
+
+
DbUserPassword
+
Password of the database user
Remarks
The password should normally never need to be requested and should only be used for sharing within the class structure.
+
+
+
+
SavePassword
+
Setting from the connection parameters whether password should be saved for linked tables
This procedure must be extended if other DBMSs (such as Oracle) are to be used.
+
+
+
+
OledbConnectionString
+
OledbConnectionString
Returns
String
+
+
+
+
OdbcConnectionString
+
OdbcConnectionString
Parameters
WithoutUserInfo
False = user ID incl. password is contained in the ODBC connection string, True = without user data
Returns
String
Remarks
Setting the parameter WithoutUserInfo is normally not necessary, but can be helpful if the ODBC connection string is required without a password.
+
+
+
+
CheckConnection
+
Public Function CheckConnection(
Optional ByRef ErrMsg
As
String
=
vbNullString
) As Boolean
+
Check connection to server and database
Parameters
ErrMsg
Error message from ADODB or ODBC connection
Returns
Boolean
True = Ado- and ODBC-connection could be established
Remarks
The first test is to establish the ADO connection. As soon as this is successful, the ODBC connection is tested.
+
+
+
+
ClearConnectionInfo
+
Public Sub ClearConnectionInfo()
+
Delete set connection parameters
Remarks
Requires re-reading from table when connection data is requested.
+
+
+
+
ChangeDbUserPassword
+
Public Function ChangeDbUserPassword(
ByVal NewPassword
As
String,
ByVal OldPassword
As
String,
Optional ByVal LoginName
As
String
=
vbNullString,
Optional ByRef Msg
As
String
) As Boolean
+
Datenbankpasswort des Benutzers ändern
Parameters
NewPassword
New passwort
OldPassword
old passwort
LoginName
Login name (If no login name is passed, the current login name is used).
Msg
ByRef parameter to return an error message if the password could not be changed
Returns
Boolean
True = Password has been changed
+
+
+
+
DMBS specific
+
+
+
+
PermanentBackendRstSqlText
+
Select statement for ODBC recordset connection to maintain connection
Remarks
This procedure must be extended if other DBMSs (such as Oracle) are to be used.
+
+
+
+
TableListSqlText
+
SQL-Anweisung im SQL-Dialtekt des DBMS zur Auflistung der im DBS enthaltenen Tabellen
Remarks
This procedure must be extended if further DBMS are to be used.
+
+
+
+
ParseTableName
+
Public Function ParseTableName(
ByVal TableName
As
String
) As String
+
Auxiliary procedure for adjusting the table name
Parameters
TableName
Table name to parse
Returns
Table name for the specific DBMS
Remarks
With some DBMS, the name must be case-sensitive or bracketed with special characters.
+
+
+
+
DateFormat
+
DBMS specific date format
Returns
Format string
+
+
+
+
WildCardString
+
DBMS specific wildcard (like *)
+
+
+
+
BooleanTrueString
+
DBMS specific string for true
+
+
+
+
LoginFormName
+
Name of the login form
Remarks
Example from ACLib: user/login/LoginForm.frm
+
+
+
+
DbmsConfigFormName
+
Name of the DBMS configuration form
+
+
+
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/DbConnectionManager-cls-Summary.js b/doc/ACLib-DbConnection-Framework/files/DbConnectionManager-cls-Summary.js
new file mode 100644
index 0000000..f0d979f
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/DbConnectionManager-cls-Summary.js
@@ -0,0 +1 @@
+NDFramePage.OnPageTitleLoaded("File:DbConnectionManager.cls","DbConnectionManager.cls");NDSummary.OnSummaryLoaded("File:DbConnectionManager.cls",[["Visual Basic","VisualBasic"]],[["Classes","Class"],["Functions","Function"],["Groups","Group"],["Properties","Property"]],[[142,0,0,"data.DbConnectionManager","data.DbConnectionManager"],[143,0,2,"Functions","data.DbConnectionManager.Functions"],[144,0,1,"Dispose","data.DbConnectionManager.Dispose"],[145,0,1,"CheckConnectionStatus","data.DbConnectionManager.CheckConnectionStatus"],[146,0,2,"Properties","data.DbConnectionManager.Properties"],[147,0,3,"DefaultSettings","data.DbConnectionManager.DefaultSettings"],[148,0,3,"ConnectionInfo","data.DbConnectionManager.ConnectionInfo"],[149,0,3,"DbConnection","data.DbConnectionManager.DbConnection"]]);
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/DbConnectionManager-cls-SummaryToolTips.js b/doc/ACLib-DbConnection-Framework/files/DbConnectionManager-cls-SummaryToolTips.js
new file mode 100644
index 0000000..e7565f1
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/DbConnectionManager-cls-SummaryToolTips.js
@@ -0,0 +1 @@
+NDSummary.OnToolTipsLoaded("File:DbConnectionManager.cls",{142:"
Class for instantiation, termination and basic control of data access classes
",144:"
Public Sub Dispose()
Remove object references
",145:"
Public Function CheckConnectionStatus() As Boolean
Test whether a connection can be established
",147:"
Test whether a connection can be established
",148:"
DbConnectionInfo instance
",149:"
DbConnectionHandler instance = Top level of the data access structure
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/DbConnectionManager-cls-ToolTips.js b/doc/ACLib-DbConnection-Framework/files/DbConnectionManager-cls-ToolTips.js
new file mode 100644
index 0000000..e1934b3
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/DbConnectionManager-cls-ToolTips.js
@@ -0,0 +1 @@
+NDContentPage.OnToolTipsLoaded({133:"
Auxiliary class for caching the connection parameters
",150:"
Auxiliary class for setting the connection parameters
",184:"
Database connection via ADODB or DAO (incl. ODBC)
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/DbConnectionManager-cls.html b/doc/ACLib-DbConnection-Framework/files/DbConnectionManager-cls.html
new file mode 100644
index 0000000..7f4cece
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/DbConnectionManager-cls.html
@@ -0,0 +1,51 @@
+
+
+DbConnectionManager.cls
+
+
+
+
+
+
+
+
+
data.DbConnectionManager
+
Class for instantiation, termination and basic control of data access classes
Encapsulates ADODB and DAO methods as well as ODBC accesses
+
+
+
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/DbConnectionSettings-cls-Summary.js b/doc/ACLib-DbConnection-Framework/files/DbConnectionSettings-cls-Summary.js
new file mode 100644
index 0000000..ca25994
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/DbConnectionSettings-cls-Summary.js
@@ -0,0 +1 @@
+NDFramePage.OnPageTitleLoaded("File:DbConnectionSettings.cls","DbConnectionSettings.cls");NDSummary.OnSummaryLoaded("File:DbConnectionSettings.cls",[["Visual Basic","VisualBasic"]],[["Classes","Class"],["Groups","Group"],["Properties","Property"]],[[133,0,0,"data.DbConnectionSettings","data.DbConnectionSettings"],[134,0,1,"Properties","data.DbConnectionSettings.Properties"],[135,0,2,"SqlDateFormat","data.DbConnectionSettings.SqlDateFormat"],[136,0,2,"SqlWildCardString","data.DbConnectionSettings.SqlWildCardString"],[137,0,2,"SqlBooleanTrueString","data.DbConnectionSettings.SqlBooleanTrueString"],[138,0,2,"DefaultAdodbCursorLocation","data.DbConnectionSettings.DefaultAdodbCursorLocation"],[139,0,2,"OpenPermanentBackendRecordset","data.DbConnectionSettings.OpenPermanentBackendRecordset"],[140,0,2,"Clone","data.DbConnectionSettings.Clone"],[141,0,2,"CopyFrom","data.DbConnectionSettings.CopyFrom"]]);
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/DbConnectionSettings-cls-SummaryToolTips.js b/doc/ACLib-DbConnection-Framework/files/DbConnectionSettings-cls-SummaryToolTips.js
new file mode 100644
index 0000000..2c13d0a
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/DbConnectionSettings-cls-SummaryToolTips.js
@@ -0,0 +1 @@
+NDSummary.OnToolTipsLoaded("File:DbConnectionSettings.cls",{133:"
Auxiliary class for caching the connection parameters
",135:"
Date format string
",136:"
SQL wildcard
",137:"
SQL string for boolean true
",138:"
Default parameter value for ADODB.CursorLocationEnum
",139:"
Open permanent backend recordset if connected
",140:"
Clone of current config
",141:"
Copy DbConnectionSettings
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/DbConnectionSettings-cls-ToolTips.js b/doc/ACLib-DbConnection-Framework/files/DbConnectionSettings-cls-ToolTips.js
new file mode 100644
index 0000000..eddcd48
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/DbConnectionSettings-cls-ToolTips.js
@@ -0,0 +1 @@
+NDContentPage.OnToolTipsLoaded({});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/DbConnectionSettings-cls.html b/doc/ACLib-DbConnection-Framework/files/DbConnectionSettings-cls.html
new file mode 100644
index 0000000..ef0c9df
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/DbConnectionSettings-cls.html
@@ -0,0 +1,55 @@
+
+
+DbConnectionSettings.cls
+
+
+
+
+
+
+
+
+
data.DbConnectionSettings
+
Auxiliary class for caching the connection parameters
Author
Josef Poetzl
+
+
+
+
Properties
+
+
+
+
SqlDateFormat
+
Date format string
+
+
+
+
SqlWildCardString
+
SQL wildcard
+
+
+
+
SqlBooleanTrueString
+
SQL string for boolean true
+
+
+
+
DefaultAdodbCursorLocation
+
Default parameter value for ADODB.CursorLocationEnum
+
+
+
+
OpenPermanentBackendRecordset
+
Open permanent backend recordset if connected
+
+
+
+
Clone
+
Clone of current config
+
+
+
+
CopyFrom
+
Copy DbConnectionSettings
Parameters
NewSettings
DbConnectionSettings to copy
+
+
+
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/SqlTools-cls-Summary.js b/doc/ACLib-DbConnection-Framework/files/SqlTools-cls-Summary.js
new file mode 100644
index 0000000..fc27d9b
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/SqlTools-cls-Summary.js
@@ -0,0 +1 @@
+NDFramePage.OnPageTitleLoaded("File:SqlTools.cls","SqlTools.cls");NDSummary.OnSummaryLoaded("File:SqlTools.cls",[["Visual Basic","VisualBasic"]],[["Classes","Class"],["Functions","Function"],["Groups","Group"],["Properties","Property"]],[[1,0,0,"data.sql.SqlTools","data.sql.SqlTools"],[2,0,2,"Class support","data.sql.SqlTools.Class_support"],[3,0,1,"Clone","data.sql.SqlTools.Clone"],[4,0,1,"NewInstance","data.sql.SqlTools.NewInstance"],[5,0,2,"SQL dialect preferences","data.sql.SqlTools.SQL_dialect_preferences"],[6,0,3,"DAO","data.sql.SqlTools.DAO"],[7,0,3,"TSql","data.sql.SqlTools.TSql"],[8,0,3,"SqlWildCardString","data.sql.SqlTools.SqlWildCardString"],[9,0,3,"SqlDateFormat","data.sql.SqlTools.SqlDateFormat"],[10,0,3,"SqlBooleanTrueString","data.sql.SqlTools.SqlBooleanTrueString"],[11,0,2,"BuildCriteria","data.sql.SqlTools.BuildCriteria"],[12,0,1,"BuildCriteria","data.sql.SqlTools.BuildCriteria(2)"],[13,0,2,"Convert to SQL","data.sql.SqlTools.Convert_to_SQL"],[14,0,1,"ConvertToSqlText","data.sql.SqlTools.ConvertToSqlText"],[15,0,1,"TextToSqlText","data.sql.SqlTools.TextToSqlText"],[16,0,1,"DateToSqlText","data.sql.SqlTools.DateToSqlText"],[17,0,1,"NumberToSqlText","data.sql.SqlTools.NumberToSqlText"],[18,0,1,"BooleanToSqlText","data.sql.SqlTools.BooleanToSqlText"]]);
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/SqlTools-cls-SummaryToolTips.js b/doc/ACLib-DbConnection-Framework/files/SqlTools-cls-SummaryToolTips.js
new file mode 100644
index 0000000..68958b9
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/SqlTools-cls-SummaryToolTips.js
@@ -0,0 +1 @@
+NDSummary.OnToolTipsLoaded("File:SqlTools.cls",{1:"
Functions to build sql strings
",3:"
Public Function Clone(
Optional ByVal NewSqlDateFormat
As
String
=
SQL_DEFAULT_DATEFORMAT,
Optional ByVal NewSqlBooleanTrueString
As
String
=
SQL_DEFAULT_BOOLTRUESTRING,
Optional ByVal NewSqlWildCardString
As
String
=
SQL_DEFAULT_WILDCARD
) As SqlTools
Create a new instance with basic settings of the current instance.
",4:"
Public Function NewInstance(
ByVal NewSqlDateFormat
As
String,
ByVal NewSqlBooleanTrueString
As
String,
ByVal NewSqlWildCardString
As
String
) As SqlTools
Create a new instance
",6:"
SqlTools instance configured for DAO-SQL (Jet/ACE)
",7:"
SqlTools instance configured for T-SQL
",8:"
Wildcard character for like
",9:"
Format for date values
",10:"
Boolean string in SQL statement
",12:"
Public Function BuildCriteria(
ByVal FieldName
As
String,
ByVal FieldDataType
As
SqlFieldDataType,
ByVal RelationalOperator
As
SqlRelationalOperators,
ByVal FilterValue
As
Variant,
Optional ByVal FilterValue2
As
Variant
=
Null,
Optional ByVal IgnoreValue
As
Variant,
Optional ByVal DisableIgnoreNullValue
As
Boolean
=
False
) As String
Create SQL criteria string
",14:"
Public Function ConvertToSqlText(
ByVal Value
As
Variant,
ByVal FieldDataType
As
SqlFieldDataType
) As String
Convert values to string for SQL statement assembled by VBA.
",15:"
Public Function TextToSqlText(
ByVal Value
As
Variant,
Optional ByVal Delimiter
As
String
=
SQL_DEFAULT_TEXTDELIMITER,
Optional ByVal WithoutLeftRightDelim
As
Boolean
=
False
) As String
Prepare text for SQL statement
",16:"
Public Function DateToSqlText(
ByVal Value
As
Variant,
Optional ByVal FormatString
As
String
=
SQL_DEFAULT_DATEFORMAT
) As String
Convert date value to string for SQL statement assembled by VBA.
",17:"
Public Function NumberToSqlText(
ByVal Value
As
Variant
) As String
Convert numeric value to string for SQL statement assembled by VBA.
",18:"
Public Function BooleanToSqlText(
ByVal Value
As
Variant,
Optional ByVal TrueString
As
String
=
SQL_DEFAULT_BOOLTRUESTRING
) As String
Prepare Boolean for SQL text
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/SqlTools-cls-ToolTips.js b/doc/ACLib-DbConnection-Framework/files/SqlTools-cls-ToolTips.js
new file mode 100644
index 0000000..eddcd48
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/SqlTools-cls-ToolTips.js
@@ -0,0 +1 @@
+NDContentPage.OnToolTipsLoaded({});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/SqlTools-cls.html b/doc/ACLib-DbConnection-Framework/files/SqlTools-cls.html
new file mode 100644
index 0000000..1b8c522
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/SqlTools-cls.html
@@ -0,0 +1,105 @@
+
+
+SqlTools.cls
+
+
+
+
+
+
+
+
+
data.sql.SqlTools
+
Functions to build sql strings
Author
Josef Poetzl
Remarks
"Attribute VB_PredeclaredId = True" to enable using SqlTools without explicit instantiation.
Warning
Don't forget to set parameters for date format, boolean and wildcard for the DBMS.
+
+
+
+
Class support
+
+
+
+
Clone
+
Public Function Clone(
Optional ByVal NewSqlDateFormat
As
String
=
SQL_DEFAULT_DATEFORMAT,
Optional ByVal NewSqlBooleanTrueString
As
String
=
SQL_DEFAULT_BOOLTRUESTRING,
Optional ByVal NewSqlWildCardString
As
String
=
SQL_DEFAULT_WILDCARD
) As SqlTools
+
Create a new instance with basic settings of the current instance.
Parameters
NewSqlDateFormat
use this date format instead of base instance
NewSqlBooleanTrueString
use this text for true instead of base instance
NewSqlWildCardString
use this wildcard string instead of base instance
Returns
SqlTools instance with config form base
See Also
NewInstance
+
+
+
+
NewInstance
+
Public Function NewInstance(
ByVal NewSqlDateFormat
As
String,
ByVal NewSqlBooleanTrueString
As
String,
ByVal NewSqlWildCardString
As
String
) As SqlTools
+
Create a new instance
+
+
+
+
SQL dialect preferences
+
+
+
+
DAO
+
SqlTools instance configured for DAO-SQL (Jet/ACE)
+
+
+
+
TSql
+
SqlTools instance configured for T-SQL
+
+
+
+
SqlWildCardString
+
Wildcard character for like
+
+
+
+
SqlDateFormat
+
Format for date values
+
+
+
+
SqlBooleanTrueString
+
Boolean string in SQL statement
+
+
+
+
BuildCriteria
+
+
+
+
BuildCriteria
+
Public Function BuildCriteria(
ByVal FieldName
As
String,
ByVal FieldDataType
As
SqlFieldDataType,
ByVal RelationalOperator
As
SqlRelationalOperators,
ByVal FilterValue
As
Variant,
Optional ByVal FilterValue2
As
Variant
=
Null,
Optional ByVal IgnoreValue
As
Variant,
Optional ByVal DisableIgnoreNullValue
As
Boolean
=
False
) As String
+
Create SQL criteria string
Parameters
FieldName
Field name in the data source to be filtered
RelationalOperator
Relational operator (=, <=, etc.)
FilterValue
Filter value (can be a single value or an array of values)
FilterValue2
Optional 2nd filter value (for Between)
IgnoreValue
The value for which no filter condition is to be created. (Array transfer of values possible)
Returns
SQL criteria string
+
+
+
+
Convert to SQL
+
+
+
+
ConvertToSqlText
+
Public Function ConvertToSqlText(
ByVal Value
As
Variant,
ByVal FieldDataType
As
SqlFieldDataType
) As String
+
Convert values to string for SQL statement assembled by VBA.
Parameters
Value
Value to convert
FieldDataType
Data type of the value to be converted
Returns
String
SQL conform string
+
+
+
+
TextToSqlText
+
Public Function TextToSqlText(
ByVal Value
As
Variant,
Optional ByVal Delimiter
As
String
=
SQL_DEFAULT_TEXTDELIMITER,
Optional ByVal WithoutLeftRightDelim
As
Boolean
=
False
) As String
+
Prepare text for SQL statement
Parameters
Value
Value to convert
Delimiter
Delimiter for text values. (In most DBMS ' is used as a delimiter).
WithoutLeftRightDelim
Only double the boundary drawing within the values, but do not set the boundary.
Returns
String
Example
strSQL = "select ... from tabelle where Feld = " & TextToSqlText("ab'cd") => strSQL = "select ... from tabelle where Feld = 'ab''cd'"
+
+
+
+
DateToSqlText
+
Public Function DateToSqlText(
ByVal Value
As
Variant,
Optional ByVal FormatString
As
String
=
SQL_DEFAULT_DATEFORMAT
) As String
+
Convert date value to string for SQL statement assembled by VBA.
Parameters
Value
Value to convert
FormatString
Date format (depends on DBMS!)
Returns
String
+
+
+
+
NumberToSqlText
+
Public Function NumberToSqlText(
ByVal Value
As
Variant
) As String
+
Convert numeric value to string for SQL statement assembled by VBA.
Parameters
Value
Value to convert
FormatString
Date format (depends on DBMS!)
Returns
String
Remarks
Str function ensures ".".
+
+
+
+
BooleanToSqlText
+
Public Function BooleanToSqlText(
ByVal Value
As
Variant,
Optional ByVal TrueString
As
String
=
SQL_DEFAULT_BOOLTRUESTRING
) As String
+
Prepare Boolean for SQL text
Parameters
Value
Value to convert
TrueString
String for true value (optional)
Returns
String
+
+
+
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/ado/AdodbHandler-cls-Summary.js b/doc/ACLib-DbConnection-Framework/files/ado/AdodbHandler-cls-Summary.js
new file mode 100644
index 0000000..b6fa3f9
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/ado/AdodbHandler-cls-Summary.js
@@ -0,0 +1 @@
+NDFramePage.OnPageTitleLoaded("File:ado/AdodbHandler.cls","AdodbHandler.cls");NDSummary.OnSummaryLoaded("File:ado/AdodbHandler.cls",[["Visual Basic","VisualBasic"]],[["Classes","Class"],["Events","Event"],["Functions","Function"],["Groups","Group"],["Properties","Property"]],[[19,0,0,"data.adodb.AdodbHandler","data.adodb.AdodbHandler"],[20,0,3,"Events","data.adodb.AdodbHandler.Events"],[21,0,1,"ErrorMissingCurrentConnection","data.adodb.AdodbHandler.ErrorMissingCurrentConnection"],[22,0,1,"ErrorEmptyOledbConnectionString","data.adodb.AdodbHandler.ErrorEmptyOledbConnectionString"],[23,0,1,"HookInsertIdentityReturn","data.adodb.AdodbHandler.HookInsertIdentityReturn"],[24,0,3,"Class control","data.adodb.AdodbHandler.Class_control"],[25,0,4,"HooksEnabled","data.adodb.AdodbHandler.HooksEnabled"],[26,0,3,"Data Connection","data.adodb.AdodbHandler.Data_Connection"],[27,0,4,"CurrentConnection","data.adodb.AdodbHandler.CurrentConnection"],[28,0,4,"ConnectionString","data.adodb.AdodbHandler.ConnectionString"],[29,0,3,"Data Operations","data.adodb.AdodbHandler.Data_Operations"],[30,0,2,"Execute","data.adodb.AdodbHandler.Execute"],[31,0,2,"ExecuteCommand","data.adodb.AdodbHandler.ExecuteCommand"],[32,0,2,"OpenRecordset","data.adodb.AdodbHandler.OpenRecordset"],[33,0,2,"OpenRecordsetCommandParam","data.adodb.AdodbHandler.OpenRecordsetCommandParam"],[34,0,2,"LookupSQL","data.adodb.AdodbHandler.LookupSQL"],[35,0,2,"Lookup","data.adodb.AdodbHandler.Lookup"],[36,0,2,"Count","data.adodb.AdodbHandler.Count"],[37,0,2,"Max","data.adodb.AdodbHandler.Max"],[38,0,2,"Min","data.adodb.AdodbHandler.Min"],[39,0,2,"Sum","data.adodb.AdodbHandler.Sum"],[40,0,2,"Exists","data.adodb.AdodbHandler.Exists"],[41,0,2,"InsertIdentityReturn","data.adodb.AdodbHandler.InsertIdentityReturn"],[42,0,2,"InsertValuesIdentityReturn","data.adodb.AdodbHandler.InsertValuesIdentityReturn"],[43,0,2,"ValueList","data.adodb.AdodbHandler.ValueList"],[44,0,2,"LookupSqlValueCollection","data.adodb.AdodbHandler.LookupSqlValueCollection"]]);
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/ado/AdodbHandler-cls-SummaryToolTips.js b/doc/ACLib-DbConnection-Framework/files/ado/AdodbHandler-cls-SummaryToolTips.js
new file mode 100644
index 0000000..df978c8
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/ado/AdodbHandler-cls-SummaryToolTips.js
@@ -0,0 +1 @@
+NDSummary.OnToolTipsLoaded("File:ado/AdodbHandler.cls",{19:"
ADODB data connection methods
",21:"
Event for missing ADODB connection reference (Passing the AdodbHandler event: data.adodb.AdodbHandler::ErrorMissingCurrentConnection)
",22:"
Event for missing OLEDB connection string
",23:"
Event for missing OLEDB connection string
",25:"
Active Hooks
",27:"
Currently set ADODB connection
",28:"
OLEDB connection string
",30:"
Public Function Execute(
ByVal CommandText
As
String,
Optional ByRef RecordsAffected
As
Long,
Optional ByVal Options
As
ADODB.ExecuteOptionEnum
=
-1
) As ADODB.Recordset
Execute SQL statement
",31:"
Public Function ExecuteCommand(
ByVal CmdText
As
String,
ByVal CmdType
As
ADODB.CommandTypeEnum,
Optional ByVal CmdParamDefs
As
Variant,
Optional ByRef RecordsAffected
As
Long,
Optional ByVal Options
As
Long
=
-1
) As ADODB.Recordset
Execute sql statement using ADODB.Command
",32:"
Public Function OpenRecordset(
ByVal Source
As
String,
Optional ByVal CursorType
As
ADODB.CursorTypeEnum
=
ADODB.CursorTypeEnum.adOpenForwardOnly,
Optional ByVal LockType
As
ADODB.LockTypeEnum
=
ADODB.LockTypeEnum.adLockReadOnly,
Optional ByVal CursorLocation
As
ADODB.CursorLocationEnum
=
-1,
Optional ByVal DisconnectedRecordset
As
Boolean
=
False
) As ADODB.Recordset
Optimizes ADODB.Recordset.Open method
",33:"
Public Function OpenRecordsetCommandParam(
ByVal CmdText
As
String,
ByVal CmdType
As
ADODB.CommandTypeEnum,
Optional ByVal CmdParamDefs
As
Variant,
Optional ByRef RecordsAffected
As
Long,
Optional ByVal Options
As
Long
=
-1,
Optional ByVal DisconnectedRecordset
As
Boolean
=
False
) As ADODB.Recordset
Open recordset using ADODB.Command
",34:"
Public Function LookupSql(
ByVal SqlText
As
String,
Optional ByVal Index
As
Variant
=
0&,
Optional ByVal ValueIfNull
As
Variant
=
Null
) As Variant
Lookup ADODB.Recordset replacement function for DLookup (passing a SQL statement)
",35:"
Public Function Lookup(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant,
Optional ByVal ValueIfNull
As
Variant
=
Null
) As Variant
ADODB.Recordset replacement function for DLookup
",36:"
Public Function Count(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Long
ADODB.Recordset replacement function for DCount
",37:"
Public Function Max(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
ADODB.Recordset replacement function for DMax
",38:"
Public Function Min(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
ADODB.Recordset replacement function for DMin
",39:"
Public Function Sum(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
ADODB.Recordset replacement function for DSum
",40:"
Public Function Exists(
ByVal Domain
As
String,
Optional ByVal Criteria
As
String
=
vbNullString
) As Boolean
Check if record exists
",41:"
Public Function InsertIdentityReturn(
ByVal InsertSql
As
String,
Optional ByVal IdentityTable
As
String
=
vbNullString
) As Variant
Execute insert SQL statement and return last identity value (auto value)
",42:"
Public Function InsertValuesIdentityReturn(
ByVal Source
As
String,
ParamArray InsertFields()
As
Variant
) As Variant
Create and execute insert SQL statement and return last identity value (auto value)
",43:"
Public Function ValueList(
ByVal SqlSource
As
String,
Optional ByVal ListConcatString
As
String
=
", ",
Optional ValueIfNull
As
Variant
=
Null
) As Variant
Generate concat string from recordset result
",44:"
Public Function LookupSqlValueCollection(
ByVal SqlSource
As
String,
Optional ByVal ValueIfNull
As
Variant
=
Null
) As Collection
Generate collection from recordset result
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/ado/AdodbHandler-cls-ToolTips.js b/doc/ACLib-DbConnection-Framework/files/ado/AdodbHandler-cls-ToolTips.js
new file mode 100644
index 0000000..b81dece
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/ado/AdodbHandler-cls-ToolTips.js
@@ -0,0 +1 @@
+NDContentPage.OnToolTipsLoaded({21:"
Event for missing ADODB connection reference (Passing the AdodbHandler event: data.adodb.AdodbHandler::ErrorMissingCurrentConnection)
",27:"
Currently set ADODB connection
",28:"
OLEDB connection string
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/ado/AdodbHandler-cls.html b/doc/ACLib-DbConnection-Framework/files/ado/AdodbHandler-cls.html
new file mode 100644
index 0000000..6e1fadc
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/ado/AdodbHandler-cls.html
@@ -0,0 +1,152 @@
+
+
+AdodbHandler.cls
+
+
+
+
+
+
+
+
Message about the cause of the event triggering. (Not yet used)
NewConnectionString
OLEDB Connectionstring
Remarks
The appropriate OLEDB connection string can be passed on via the ByRef parameter NewConnectionString.
+
+
+
+
HookInsertIdentityReturn
+
Event for missing OLEDB connection string
Parameters
InsertSql
SQL text of insert statement
IdentityTable
Identity table
ActiveConnection
ADODB Connection to use
IdentitySelectString
Input string to use
HookResponseMode
resume action after event call: 0 ... code resume after event, 1 exit function after event
HookResponseMessage
return value of function (e.g. InsertIdentityReturn) when HookResumeMode <> 0
Remarks
New values can be passed on via the ByRef parameters.
+
+
+
+
Class control
+
+
+
+
HooksEnabled
+
Active Hooks
Remarks
Used in InsertIdentityReturn
+
+
+
+
Data Connection
+
+
+
+
CurrentConnection
+
Get
Currently set ADODB connection
Set
Set new ADODB connection
Remarks
If there is no ADODB connection yet, a new ADODB connection will be created. Instantiation flow: 1. raiseEvent #ErrorMissingCurrentConnection ... if no connection was passed: 2. create new ADODB connection based on the OLEDB connection string (use property data.adodb.AdodbHandler::ConnectionString)
If a reference to an ADODB connection already exists, it will be checked if it is closed and opened if necessary.
+
+
+
+
ConnectionString
+
OLEDB connection string
+
+
+
+
Data Operations
+
+
+
+
Execute
+
Public Function Execute(
ByVal CommandText
As
String,
Optional ByRef RecordsAffected
As
Long,
Optional ByVal Options
As
ADODB.ExecuteOptionEnum
=
-1
) As ADODB.Recordset
+
Execute SQL statement
Parameters
CommandText
SQL statement
RecordsAffected
ByRef parameter to return the number of records affected by the Execute statement.
Options
additional options of the ADODB.Connection.Execute method
Returns
ADODB.Recordset
Remarks
Encapsulation of the ADODB.Connection.Execute method (parameters are passed on 1:1)
ByRef parameter to return the number of records affected by the Execute statement.
Options
additional options of the ADODB.Command.Execute method
Returns
ADODB.Recordset
Remarks
With this variant, SQL injection can be avoided very easily, since the parameters are not built directly into the SQL statement and thus a parameter value (which comes from a user input, for example) cannot inject an SQL statement.
+
+
+
+
OpenRecordset
+
Public Function OpenRecordset(
ByVal Source
As
String,
Optional ByVal CursorType
As
ADODB.CursorTypeEnum
=
ADODB.CursorTypeEnum.adOpenForwardOnly,
Optional ByVal LockType
As
ADODB.LockTypeEnum
=
ADODB.LockTypeEnum.adLockReadOnly,
Optional ByVal CursorLocation
As
ADODB.CursorLocationEnum
=
-1,
Optional ByVal DisconnectedRecordset
As
Boolean
=
False
) As ADODB.Recordset
+
Optimizes ADODB.Recordset.Open method
Parameters
Source
Data source (e.g. SQL statement)
CursorType
ADODB.CursorTypeEnum value
LockType
ADODB.LockTypeEnum value
CursorLocation
ADODB.CursorLocationEnum value
DisconnectedRecordset
True: disconnect connection from recordset after opening
ByRef parameter to return the number of records affected by the Execute statement.
Options
additional options of the ADODB.Command.Execute method
DisconnectedRecordset
True: disconnect connection from recordset after opening
Returns
ADODB.Recordset
Remarks
With this variant, SQL injection can be avoided very easily, since the parameters are not built directly into the SQL statement and thus a parameter value (which comes from a user input, for example) cannot inject an SQL statement.
+
+
+
+
LookupSQL
+
Public Function LookupSql(
ByVal SqlText
As
String,
Optional ByVal Index
As
Variant
=
0&,
Optional ByVal ValueIfNull
As
Variant
=
Null
) As Variant
+
Lookup ADODB.Recordset replacement function for DLookup (passing a SQL statement)
Parameters
SqlText
SQL statement
Index
Field selection if the first field of the recordset is not to be returned. The index is passed in the same way as ADODB.Recordset.Fields(index).
ValueIfNull
Return value if record is missing or data field value is Null (default: Null).
Returns
Variant
Null, if SQL statement does not return a record.
Remarks
The SQL statement must be written in the SQL dialect of the DBMS concerned.
+
+
+
+
Lookup
+
Public Function Lookup(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant,
Optional ByVal ValueIfNull
As
Variant
=
Null
) As Variant
+
ADODB.Recordset replacement function for DLookup
Parameters
Expr
Field name or calculated expression (select part)
Domain
Table, query or SQL expression for sub-query (FROM part)
Criteria
(Optional) Criteria string (WHERE part)
ValueIfNull
Return value if record is missing or data field value is Null (default: Null).
Returns
Variant
+
+
+
+
Count
+
Public Function Count(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Long
+
ADODB.Recordset replacement function for DCount
Parameters
Expr
Field name or calculated expression (select part)
Domain
Table, query or SQL expression for sub-query (FROM part)
Criteria
(Optional) Criteria string (WHERE part)
Returns
Long
+
+
+
+
Max
+
Public Function Max(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
+
ADODB.Recordset replacement function for DMax
Parameters
Expr
Field name or calculated expression (select part)
Domain
Table, query or SQL expression for sub-query (FROM part)
Criteria
(Optional) Criteria string (WHERE part)
Returns
Variant
+
+
+
+
Min
+
Public Function Min(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
+
ADODB.Recordset replacement function for DMin
Parameters
Expr
Field name or calculated expression (select part)
Domain
Table, query or SQL expression for sub-query (FROM part)
Criteria
(Optional) Criteria string (WHERE part)
Returns
Variant
+
+
+
+
Sum
+
Public Function Sum(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
+
ADODB.Recordset replacement function for DSum
Parameters
Expr
Field name or calculated expression (select part)
Domain
Table, query or SQL expression for sub-query (FROM part)
Criteria
(Optional) Criteria string (WHERE part)
Returns
Variant
+
+
+
+
Exists
+
Public Function Exists(
ByVal Domain
As
String,
Optional ByVal Criteria
As
String
=
vbNullString
) As Boolean
+
Check if record exists
Parameters
Domain
data source (FROM part)
Criteria
(Optional) Criteria string (WHERE part)
Returns
Boolean
+
+
+
+
InsertIdentityReturn
+
Public Function InsertIdentityReturn(
ByVal InsertSql
As
String,
Optional ByVal IdentityTable
As
String
=
vbNullString
) As Variant
+
Execute insert SQL statement and return last identity value (auto value)
Parameters
InsertSQL
Insert SQL statement
Returns
Identity value or NULL if no record was appended
Remarks
Works for Jet only from Jet 4.0 (Access 2000), IdentityTable is only applicable for MSSQL, under MySQL the IDENT_CURRENT function does not exist.
+
+
+
+
InsertValuesIdentityReturn
+
Public Function InsertValuesIdentityReturn(
ByVal Source
As
String,
ParamArray InsertFields()
As
Variant
) As Variant
+
Create and execute insert SQL statement and return last identity value (auto value)
Works for Jet only from Jet 4.0 (Access 2000), IdentityTable is only applicable for MSSQL, under MySQL the IDENT_CURRENT function does not exist.
+
+
+
+
ValueList
+
Public Function ValueList(
ByVal SqlSource
As
String,
Optional ByVal ListConcatString
As
String
=
", ",
Optional ValueIfNull
As
Variant
=
Null
) As Variant
+
Generate concat string from recordset result
Parameters
SqlSource
Select statement
ListConcatString
(optional) Character to join results, Default = ", "
ValueIfNull
(optional) Value if no results, Default = Null
Returns
Variant
result exists: string, no result exists: ValueIfNull
+
+
+
+
LookupSqlValueCollection
+
Public Function LookupSqlValueCollection(
ByVal SqlSource
As
String,
Optional ByVal ValueIfNull
As
Variant
=
Null
) As Collection
+
Generate collection from recordset result
Parameters
SqlSource
Select statement
ValueIfNull
(optional) Value if no results, Default = Null
Returns
Collection
+
+
+
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/dao/DaoHandler-cls-Summary.js b/doc/ACLib-DbConnection-Framework/files/dao/DaoHandler-cls-Summary.js
new file mode 100644
index 0000000..278625f
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/dao/DaoHandler-cls-Summary.js
@@ -0,0 +1 @@
+NDFramePage.OnPageTitleLoaded("File:dao/DaoHandler.cls","DaoHandler.cls");NDSummary.OnSummaryLoaded("File:dao/DaoHandler.cls",[["Visual Basic","VisualBasic"]],[["Classes","Class"],["Events","Event"],["Functions","Function"],["Groups","Group"],["Properties","Property"]],[[80,0,0,"data.dao.DaoHandler","data.dao.DaoHandler"],[81,0,3,"Events","data.dao.DaoHandler.Events"],[82,0,1,"ErrorMissingCurrentDb","data.dao.DaoHandler.ErrorMissingCurrentDb"],[83,0,3,"Class control","data.dao.DaoHandler.Class_control"],[84,0,2,"Dispose","data.dao.DaoHandler.Dispose"],[85,0,2,"InitRecordsetEnumDefaultValues","data.dao.DaoHandler.InitRecordsetEnumDefaultValues"],[86,0,3,"Data Connection","data.dao.DaoHandler.Data_Connection"],[87,0,4,"CurrentDb","data.dao.DaoHandler.CurrentDb"],[88,0,3,"Data Operations","data.dao.DaoHandler.Data_Operations"],[89,0,2,"Execute","data.dao.DaoHandler.Execute"],[90,0,2,"ExecuteParamSQL","data.dao.DaoHandler.ExecuteParamSQL"],[91,0,2,"ExecuteQueryDefByName","data.dao.DaoHandler.ExecuteQueryDefByName"],[92,0,2,"ExecuteQueryDef","data.dao.DaoHandler.ExecuteQueryDef"],[93,0,2,"ParamQueryDefByName","data.dao.DaoHandler.ParamQueryDefByName"],[94,0,2,"ParamQueryDefSql","data.dao.DaoHandler.ParamQueryDefSql"],[95,0,2,"OpenRecordset","data.dao.DaoHandler.OpenRecordset"],[96,0,2,"OpenRecordsetParamSQL","data.dao.DaoHandler.OpenRecordsetParamSQL"],[97,0,2,"OpenRecordsetParamSql2","data.dao.DaoHandler.OpenRecordsetParamSql2"],[98,0,2,"GetParamDefArray","data.dao.DaoHandler.GetParamDefArray"],[99,0,2,"GetNamedParamDefArray","data.dao.DaoHandler.GetNamedParamDefArray"],[100,0,2,"OpenRecordsetQueryDefByName","data.dao.DaoHandler.OpenRecordsetQueryDefByName"],[101,0,2,"OpenRecordsetQueryDef","data.dao.DaoHandler.OpenRecordsetQueryDef"],[102,0,2,"LookupSQL","data.dao.DaoHandler.LookupSQL"],[103,0,2,"Lookup","data.dao.DaoHandler.Lookup"],[104,0,2,"Count","data.dao.DaoHandler.Count"],[105,0,2,"Max","data.dao.DaoHandler.Max"],[106,0,2,"Min","data.dao.DaoHandler.Min"],[107,0,2,"Sum","data.dao.DaoHandler.Sum"],[108,0,2,"Exists","data.dao.DaoHandler.Exists"],[109,0,2,"InsertIdentityReturn","data.dao.DaoHandler.InsertIdentityReturn"],[110,0,2,"InsertValues","data.dao.DaoHandler.InsertValues"],[111,0,2,"InsertValuesReturnFieldValue","data.dao.DaoHandler.InsertValuesReturnFieldValue"],[112,0,2,"NewRecord","data.dao.DaoHandler.NewRecord"],[113,0,2,"CopyRecord","data.dao.DaoHandler.CopyRecord"],[114,0,2,"CopyRecords","data.dao.DaoHandler.CopyRecords"],[115,0,2,"CopyRecordsReturnFieldValue","data.dao.DaoHandler.CopyRecordsReturnFieldValue"]]);
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/dao/DaoHandler-cls-SummaryToolTips.js b/doc/ACLib-DbConnection-Framework/files/dao/DaoHandler-cls-SummaryToolTips.js
new file mode 100644
index 0000000..dccb844
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/dao/DaoHandler-cls-SummaryToolTips.js
@@ -0,0 +1 @@
+NDSummary.OnToolTipsLoaded("File:dao/DaoHandler.cls",{80:"
DAO data connection methods
",82:"
Event for missing CurrentDb reference
",84:"
Public Sub Dispose()
Remove object references
",85:"
Public Sub InitRecordsetEnumDefaultValues(
Optional ByRef RecordsetType
As
DAO.RecordsetTypeEnum,
Optional ByRef Options
As
DAO.RecordsetOptionEnum,
Optional ByRef LockEdit
As
DAO.LockTypeEnum
)
Set default values for recordset enums, which are used when parameters cannot be set.
",87:"
CurrentDbC variant
",89:"
Public Function Execute(
ByVal Query
As
String,
Optional ByVal Options
As
DAO.RecordsetOptionEnum
) As Long
Execute SQL statement
",90:"
Public Function ExecuteParamSql(
ByVal SqlText
As
String,
ParamArray QueryParams()
As
Variant
) As Long
Execute SQL statement with parameters
",91:"
Public Function ExecuteQueryDefByName(
ByVal QueryName
As
String,
ParamArray QueryParams()
As
Variant
) As Long
Execute saved query (optionally with parameters)
",92:"
Public Function ExecuteQueryDef(
ByVal QdfRef
As
DAO.QueryDef,
ParamArray QueryParams()
As
Variant
) As Long
Fill QueryDef object with parameter values and then execute it
",93:"
Public Function ParamQueryDefByName(
ByVal QueryName
As
String,
ParamArray QueryParams()
As
Variant
) As DAO.QueryDef
Open saved query as QueryDef object incl. passed parameter values
Open parameter SQL statement (uses temporary QueryDef)
",97:"
Public Function OpenRecordsetParamSql2(
ByVal ParamSqlText
As
String,
ParamArray QueryParams()
As
Variant
) As DAO.Recordset
Open parameter SQL statement (like OpenRecordsetParamSQL, but with default values for RecordsetType, RecordsetOptions and LockEdit)
",98:"
Public Function GetParamDefArray(
ParamArray ParamValues()
As
Variant
) As Variant
Creates 2-dimensional parameter array (e.g. for OpenRecordsetQueryDef)
",99:"
Public Function GetNamedParamDefArray(
ParamArray ParamIndexAndValues()
As
Variant
) As Variant
Creates 2-dimensional parameter array (e.g. for OpenRecordsetQueryDef)
",100:"
Public Function OpenRecordsetQueryDefByName(
ByVal QueryName
As
String,
Optional ByVal QueryParams
As
Variant,
Optional ByVal RecordsetType
As
DAO.RecordsetTypeEnum,
Optional ByVal Options
As
DAO.RecordsetOptionEnum,
Optional ByVal LockEdit
As
DAO.LockTypeEnum
) As DAO.Recordset
Open recordset from saved query (optionally with parameters)
",101:"
Public Function OpenRecordsetQueryDef(
ByVal QdfRef
As
DAO.QueryDef,
Optional ByVal QueryParams
As
Variant,
Optional ByVal RecordsetType
As
DAO.RecordsetTypeEnum,
Optional ByVal RecordsetOptions
As
DAO.RecordsetOptionEnum,
Optional ByVal LockEdit
As
DAO.LockTypeEnum
) As DAO.Recordset
Recordset von gespeicherter Abfrage (optional mit Parametern) öffnen
",102:"
Public Function LookupSql(
ByVal SqlText
As
String,
Optional ByVal Index
As
Variant
=
0&,
Optional ByVal ValueIfNull
As
Variant
=
Null
) As Variant
Lookup DAO.Recordset replacement function for DLookup (passing a SQL statement)
",103:"
Public Function Lookup(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant,
Optional ByVal ValueIfNull
As
Variant
=
Null
) As Variant
DAO.Recordset replacement function for DLookup
",104:"
Public Function Count(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Long
DAO.Recordset replacement function for DCount
",105:"
Public Function Max(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
DAO.Recordset replacement function for DMax
",106:"
Public Function Min(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
DAO.Recordset replacement function for DMin
",107:"
Public Function Sum(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
DAO.Recordset replacement function for DSum
",108:"
Public Function Exists(
ByVal Domain
As
String,
Optional ByVal Criteria
As
String
=
vbNullString
) As Boolean
Check if record exists
",109:"
Public Function InsertIdentityReturn(
ByVal InsertSql
As
String
) As Variant
Execute insert SQL statement and return last identity value (auto value)
",110:"
Public Function InsertValues(
ByVal Source
As
String,
ParamArray FieldsAndValues()
As
Variant
) As Boolean
Open recordset and append values
",111:"
Public Function InsertValuesReturnFieldValue(
ByVal Source
As
String,
ByVal ReturnFieldNameOrIndex
As
Variant,
ParamArray FieldsAndValues()
As
Variant
) As Variant
Ropen ecordset and append values, returns value of a defined data field
",112:"
Public Function NewRecord(
ByVal Source
As
String,
ByVal ReturnFieldName
As
String,
ParamArray FieldsAndValues()
As
Variant
) As Variant
Append record via recordset and set field values.
",113:"
Public Function CopyRecord(
ByVal Source
As
String,
ByVal StartFieldNumber
As
Long,
ByVal LastFieldNumber
As
Long,
ByVal ReturnFieldName
As
String,
ParamArray DataToChange()
As
Variant
) As Variant
Copy data set and change individual values
",114:"
Public Function CopyRecords(
ByVal Source
As
String,
ByVal StartFieldNumber
As
Long,
ByVal LastFieldNumber
As
Long,
ParamArray DataToChange()
As
Variant
) As Boolean
Recordset öffnen und Werte eines Datensatzes anfügen
",115:"
Public Function CopyRecordsReturnFieldValue(
ByVal Source
As
String,
ByVal StartFieldNumber
As
Long,
ByVal LastFieldNumber
As
Long,
ByVal ReturnFieldName
As
String,
ParamArray DataToChange()
As
Variant
) As Variant
/** <summary> Datensätze kopieren und Werte ändern
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/dao/DaoHandler-cls-ToolTips.js b/doc/ACLib-DbConnection-Framework/files/dao/DaoHandler-cls-ToolTips.js
new file mode 100644
index 0000000..b740606
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/dao/DaoHandler-cls-ToolTips.js
@@ -0,0 +1 @@
+NDContentPage.OnToolTipsLoaded({41:"
Public Function InsertIdentityReturn(
ByVal InsertSql
As
String,
Optional ByVal IdentityTable
As
String
=
vbNullString
) As Variant
Execute insert SQL statement and return last identity value (auto value)
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/dao/DaoHandler-cls.html b/doc/ACLib-DbConnection-Framework/files/dao/DaoHandler-cls.html
new file mode 100644
index 0000000..b042776
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/dao/DaoHandler-cls.html
@@ -0,0 +1,216 @@
+
+
+DaoHandler.cls
+
+
+
+
+
+
+
+
+
data.dao.DaoHandler
+
DAO data connection methods
Author
Josef Poetzl
+
+
+
+
Events
+
+
+
+
ErrorMissingCurrentDb
+
Event for missing CurrentDb reference
Parameters
Msg
Message about the cause of the event triggering. (Not yet used)
NewCurrentDbRef
DAO.Database reference to be used for CurrentDb
Remarks
The required DAO.Database reference can be passed on via the ByRef parameter NewCurrentDbRef.
+
+
+
+
Class control
+
+
+
+
Dispose
+
Public Sub Dispose()
+
Remove object references
+
+
+
+
InitRecordsetEnumDefaultValues
+
Public Sub InitRecordsetEnumDefaultValues(
Optional ByRef RecordsetType
As
DAO.RecordsetTypeEnum,
Optional ByRef Options
As
DAO.RecordsetOptionEnum,
Optional ByRef LockEdit
As
DAO.LockTypeEnum
)
+
Set default values for recordset enums, which are used when parameters cannot be set.
Parameters
RecordsetType
DAO.RecordsetTypeEnum
Options
DAO.RecordsetOptionEnum
LockEdit
DAO.LockTypeEnum
Remarks
If 0 is set, standard of DAO is used (0 parameters are passed on to DAO as "IsMissing" variant value).
+
+
+
+
Data Connection
+
+
+
+
CurrentDb
+
CurrentDbC variant
Returns
DAO.Database
Remarks
CurrentDbC variant which, unlike the original version by Michael Kaplan, does not automatically set the DAO database reference to Access.Application.CurrentDb, but requests it via an event if no reference exists yet. This allows any database reference to be passed via the main application. (e.g. if a temp database is to serve as CurrentDb).
+
+
+
+
Data Operations
+
+
+
+
Execute
+
Public Function Execute(
ByVal Query
As
String,
Optional ByVal Options
As
DAO.RecordsetOptionEnum
) As Long
+
Execute SQL statement
Parameters
CommandText
SQL statement (String)
Options
DAO.RecordsetOptionEnum
Returns
RecordsAffected (Long)
+
+
+
+
ExecuteParamSQL
+
Public Function ExecuteParamSql(
ByVal SqlText
As
String,
ParamArray QueryParams()
As
Variant
) As Long
+
Execute SQL statement with parameters
Parameters
SqlText
SQL statement
QueryParams
Values in suitable order as ParamArray or as array or 2-dimensional parameter array (Array(n,1) ... x(n,0) = parameter name, x(n,1) = parameter value) ... generateable with GetParamDefArray or GetNamedParamDefArray
Returns
RecordsAffected (Long)
+
+
+
+
ExecuteQueryDefByName
+
Public Function ExecuteQueryDefByName(
ByVal QueryName
As
String,
ParamArray QueryParams()
As
Variant
) As Long
+
Execute saved query (optionally with parameters)
Parameters
QueryName
QueryDef name
QueryParams
Values in suitable order as ParamArray or as array or 2-dimensional parameter array (Array(n,1) ... x(n,0) = parameter name, x(n,1) = parameter value) ... generateable with GetParamDefArray or GetNamedParamDefArray
Returns
RecordsAffected (Long)
+
+
+
+
ExecuteQueryDef
+
Public Function ExecuteQueryDef(
ByVal QdfRef
As
DAO.QueryDef,
ParamArray QueryParams()
As
Variant
) As Long
+
Fill QueryDef object with parameter values and then execute it
Parameters
QdfRef
QueryDef reference
QueryParams
Values in suitable order as ParamArray or as array or 2-dimensional parameter array (Array(n,1) ... x(n,0) = parameter name, x(n,1) = parameter value) ... generateable with GetParamDefArray or GetNamedParamDefArray
Returns
RecordsAffected (Long)
+
+
+
+
ParamQueryDefByName
+
Public Function ParamQueryDefByName(
ByVal QueryName
As
String,
ParamArray QueryParams()
As
Variant
) As DAO.QueryDef
+
Open saved query as QueryDef object incl. passed parameter values
Parameters
QueryName
name of query with parameters
QueryParams
Values in suitable order as ParamArray or as array or 2-dimensional parameter array (Array(n,1) ... x(n,0) = parameter name, x(n,1) = parameter value) ... generateable with GetParamDefArray or GetNamedParamDefArray
Values in suitable order as ParamArray or as array or 2-dimensional parameter array (Array(n,1) ... x(n,0) = parameter name, x(n,1) = parameter value) ... generateable with GetParamDefArray or GetNamedParamDefArray
Returns
DAO.QueryDef
+
+
+
+
OpenRecordset
+
Public Function OpenRecordset(
ByVal Source
As
String,
Optional ByVal RecordsetType
As
DAO.RecordsetTypeEnum
=
dbOpenDynaset,
Optional ByVal RecordsetOptions
As
DAO.RecordsetOptionEnum
=
DAO.RecordsetOptionEnum.dbSeeChanges,
Optional ByVal LockEdit
As
DAO.LockTypeEnum
) As DAO.Recordset
+
Open DAO.Recordset
Parameters
Source
SQL statement or table or query name
RecordsetType
DAO.RecordsetTypeEnum (Standard: dbOpenDynaset)
RecordsetOptions
DAO.RecordsetOptionEnum (Standard: dbSeeChanges)
LockEdit
DAO.LockTypeEnum (Standard: dbOptimistic)
Returns
DAO.Recordset
+
+
+
+
OpenRecordsetParamSQL
+
Public Function OpenRecordsetParamSql(
ByVal ParamSqlText
As
String,
ByVal RecordsetType
As
DAO.RecordsetTypeEnum,
ByVal Options
As
DAO.RecordsetOptionEnum,
ByVal LockEdit
As
DAO.LockTypeEnum,
ParamArray QueryParams()
As
Variant
) As DAO.Recordset
+
Open parameter SQL statement (uses temporary QueryDef)
Parameters
ParamSqlText
SQL statement with parameters (parameter declaration)
RecordsetType
DAO.RecordsetTypeEnum (Standard: dbOpenDynaset)
RecordsetOptions
DAO.RecordsetOptionEnum (Standard: dbSeeChanges)
LockEdit
DAO.LockTypeEnum (Standard: dbOptimistic)
QueryParams
Values in suitable order as ParamArray or as array or 2-dimensional parameter array (Array(n,1) ... x(n,0) = parameter name, x(n,1) = parameter value) ... generateable with GetParamDefArray or GetNamedParamDefArray
Returns
DAO.Recordset
+
+
+
+
OpenRecordsetParamSql2
+
Public Function OpenRecordsetParamSql2(
ByVal ParamSqlText
As
String,
ParamArray QueryParams()
As
Variant
) As DAO.Recordset
+
Open parameter SQL statement (like OpenRecordsetParamSQL, but with default values for RecordsetType, RecordsetOptions and LockEdit)
Parameters
ParamSqlText
SQL statement with parameters (parameter declaration)
QueryParams
Values in suitable order as ParamArray or as array or 2-dimensional parameter array (Array(n,1) ... x(n,0) = parameter name, x(n,1) = parameter value) ... generateable with GetParamDefArray or GetNamedParamDefArray'
Returns
DAO.Recordset
+
+
+
+
GetParamDefArray
+
Public Function GetParamDefArray(
ParamArray ParamValues()
As
Variant
) As Variant
+
Creates 2-dimensional parameter array (e.g. for OpenRecordsetQueryDef)
Parameters
ParamValues
Parmeter values in matching order (without index identifier!)
Returns
Variant (Array)
+
+
+
+
GetNamedParamDefArray
+
Public Function GetNamedParamDefArray(
ParamArray ParamIndexAndValues()
As
Variant
) As Variant
+
Creates 2-dimensional parameter array (e.g. for OpenRecordsetQueryDef)
Parameters
ParamValues
Parameter pairs: alternating parameter index and parameter value
Returns
Variant (Array)
+
+
+
+
OpenRecordsetQueryDefByName
+
Public Function OpenRecordsetQueryDefByName(
ByVal QueryName
As
String,
Optional ByVal QueryParams
As
Variant,
Optional ByVal RecordsetType
As
DAO.RecordsetTypeEnum,
Optional ByVal Options
As
DAO.RecordsetOptionEnum,
Optional ByVal LockEdit
As
DAO.LockTypeEnum
) As DAO.Recordset
+
Open recordset from saved query (optionally with parameters)
Parameters
QueryName
Name of the saved query
QueryParams
Values in suitable order as ParamArray or as array or 2-dimensional parameter array (Array(n,1) ... x(n,0) = parameter name, x(n,1) = parameter value) ... generateable with GetParamDefArray or GetNamedParamDefArray'
RecordsetType
DAO.RecordsetTypeEnum (Standard: dbOpenDynaset)
RecordsetOptions
DAO.RecordsetOptionEnum (Standard: dbSeeChanges)
LockEdit
DAO.LockTypeEnum (Standard: dbOptimistic)
Returns
DAO.Recordset
+
+
+
+
OpenRecordsetQueryDef
+
Public Function OpenRecordsetQueryDef(
ByVal QdfRef
As
DAO.QueryDef,
Optional ByVal QueryParams
As
Variant,
Optional ByVal RecordsetType
As
DAO.RecordsetTypeEnum,
Optional ByVal RecordsetOptions
As
DAO.RecordsetOptionEnum,
Optional ByVal LockEdit
As
DAO.LockTypeEnum
) As DAO.Recordset
+
Recordset von gespeicherter Abfrage (optional mit Parametern) öffnen
Parameters
QdfRef
QueryDef reference
QueryParams
Values in suitable order as ParamArray or as array or 2-dimensional parameter array (Array(n,1) ... x(n,0) = parameter name, x(n,1) = parameter value) ... generateable with GetParamDefArray or GetNamedParamDefArray'
RecordsetType
DAO.RecordsetTypeEnum (Standard: dbOpenDynaset)
RecordsetOptions
DAO.RecordsetOptionEnum (Standard: dbSeeChanges)
LockEdit
DAO.LockTypeEnum (Standard: dbOptimistic)
Returns
DAO.Recordset
+
+
+
+
LookupSQL
+
Public Function LookupSql(
ByVal SqlText
As
String,
Optional ByVal Index
As
Variant
=
0&,
Optional ByVal ValueIfNull
As
Variant
=
Null
) As Variant
+
Lookup DAO.Recordset replacement function for DLookup (passing a SQL statement)
Parameters
SqlText
SQL statement
Index
Field selection if the first field of the recordset is not to be returned. The index is passed in the same way as ADODB.Recordset.Fields(index).
ValueIfNull
Return value if record is missing or data field value is Null (default: Null).
Returns
Variant
Null, if SQL statement does not return a record.
Remarks
The SQL statement must be written in the Jet/ACE SQL dialect.
+
+
+
+
Lookup
+
Public Function Lookup(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant,
Optional ByVal ValueIfNull
As
Variant
=
Null
) As Variant
+
DAO.Recordset replacement function for DLookup
Parameters
Expr
Field name or calculated expression (select part)
Domain
Table, query or SQL expression for sub-query (FROM part)
Criteria
(Optional) Criteria string (WHERE part)
ValueIfNull
Return value if record is missing or data field value is Null (default: Null).
Returns
Variant
+
+
+
+
Count
+
Public Function Count(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Long
+
DAO.Recordset replacement function for DCount
Parameters
Expr
Field name or calculated expression (select part)
Domain
Table, query or SQL expression for sub-query (FROM part)
Criteria
(optional) Criteria string (WHERE part)
Returns
Long
+
+
+
+
Max
+
Public Function Max(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
+
DAO.Recordset replacement function for DMax
Parameters
Expr
Field name or calculated expression (select part)
Domain
Table, query or SQL expression for sub-query (FROM part)
Criteria
(Optional) Criteria string (WHERE part)
Returns
Variant
+
+
+
+
Min
+
Public Function Min(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
+
DAO.Recordset replacement function for DMin
Parameters
Expr
Field name or calculated expression (select part)
Domain
Table, query or SQL expression for sub-query (FROM part)
Criteria
(Optional) Criteria string (WHERE part)
Returns
Variant
+
+
+
+
Sum
+
Public Function Sum(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
+
DAO.Recordset replacement function for DSum
Parameters
Expr
Field name or calculated expression (select part)
Domain
Table, query or SQL expression for sub-query (FROM part)
Criteria
(Optional) Criteria string (WHERE part)
Returns
Variant
+
+
+
+
Exists
+
Public Function Exists(
ByVal Domain
As
String,
Optional ByVal Criteria
As
String
=
vbNullString
) As Boolean
+
Check if record exists
Parameters
Domain
data source (FROM part)
Criteria
(Optional) Criteria string (WHERE part)
Returns
Boolean
+
+
+
+
InsertIdentityReturn
+
Public Function InsertIdentityReturn(
ByVal InsertSql
As
String
) As Variant
+
Execute insert SQL statement and return last identity value (auto value)
Parameters
InsertSQL
Insert SQL statement
Returns
Identity value or NULL if no record was appended
Remarks
Works for Jet only from Jet 4.0 (Access 2000), IdentityTable is only applicable for MSSQL, under MySQL the IDENT_CURRENT function does not exist. (data.adodb.AdodbHandler::InsertIdentityReturn is more suitable regarding use for active DBMS.)
Since a recordset is used for insertion, there is no data type check in the code -> watch out for implicit conversion.
+
+
+
+
NewRecord
+
Public Function NewRecord(
ByVal Source
As
String,
ByVal ReturnFieldName
As
String,
ParamArray FieldsAndValues()
As
Variant
) As Variant
+
Append record via recordset and set field values.
Parameters
Source
Data source (table name or SQL statement)
ReturnFieldName
Field name whose value is to be returned (e.g. autonumber field).
FieldsAndValues
new data ... ParamArray: "Field1", Value1, "Field2", Value2, ....
Returns
Value from ReturnFieldName, or True/False if no ReturnFieldName was specified.
+
+
+
+
CopyRecord
+
Public Function CopyRecord(
ByVal Source
As
String,
ByVal StartFieldNumber
As
Long,
ByVal LastFieldNumber
As
Long,
ByVal ReturnFieldName
As
String,
ParamArray DataToChange()
As
Variant
) As Variant
+
Copy data set and change individual values
Parameters
Source
Data source (table name or SQL statement)
StartFieldNumber
Data field number (=field index+1) from which the data is copied
LastFieldNumber
Data field number (=field index+1) up to which the data are copied. A negative value counts from behind.
ReturnFieldName
Field name whose value is to be returned (e.g. auto number field).
DataToChange
data to be changed ... alternating: field name, field value - ParamArray: "Field1", Value1, "Field2", Value2, ....
Returns
Value from ReturnFieldName, or True/False if no ReturnFieldName was specified.
+
+
+
+
CopyRecords
+
Public Function CopyRecords(
ByVal Source
As
String,
ByVal StartFieldNumber
As
Long,
ByVal LastFieldNumber
As
Long,
ParamArray DataToChange()
As
Variant
) As Boolean
+
Recordset öffnen und Werte eines Datensatzes anfügen
Parameters
Source
Data source (table name or SQL statement)
StartFieldNumber
Data field number (=field index+1) from which the data is copied
LastFieldNumber
Data field number (=field index+1) up to which the data are copied. A negative value counts from behind.
DataToChange
data to be changed ... alternating: field name, field value - ParamArray: "Field1", Value1, "Field2", Value2, ....
Returns
Boolean
True if success
Remarks
Since a recordset is used for insertion, there is no data type check in the code -> watch out for implicit conversion.
+
+
+
+
CopyRecordsReturnFieldValue
+
Public Function CopyRecordsReturnFieldValue(
ByVal Source
As
String,
ByVal StartFieldNumber
As
Long,
ByVal LastFieldNumber
As
Long,
ByVal ReturnFieldName
As
String,
ParamArray DataToChange()
As
Variant
) As Variant
+
/** <summary> Datensätze kopieren und Werte ändern
Parameters
Source
Data source (table name or SQL statement)
StartFieldNumber
Data field number (=field index+1) from which the data is copied
LastFieldNumber
Data field number (=field index+1) up to which the data are copied. A negative value counts from behind.
ReturnFieldName
Field name whose value is to be returned (e.g. auto number field).
DataToChange
data to be changed ... alternating: field name, field value - ParamArray: "Field1", Value1, "Field2", Value2, ....
Returns
Value from ReturnFieldName, or True/False if no ReturnFieldName was specified.
Remarks
Since a recordset is used for insertion, there is no data type check in the code -> watch out for implicit conversion.
+
+
+
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/defDbConnection-bas-Summary.js b/doc/ACLib-DbConnection-Framework/files/defDbConnection-bas-Summary.js
new file mode 100644
index 0000000..54d6ca5
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/defDbConnection-bas-Summary.js
@@ -0,0 +1 @@
+NDFramePage.OnPageTitleLoaded("File:defDbConnection.bas","defDbConnection.bas");NDSummary.OnSummaryLoaded("File:defDbConnection.bas",[["Visual Basic","VisualBasic"]],[["Classes","Class"],["Constants","Constant"],["Enums","Enumeration"],["Groups","Group"],["Types","Type"]],[[125,0,0,"data.defDbConnection","data.defDbConnection"],[126,0,3,"Types","data.defDbConnection.Types"],[127,0,4,"DbmsConnectionStrings","data.defDbConnection.DbmsConnectionStrings"],[128,0,3,"Enums","data.defDbConnection.Enums"],[129,0,2,"DbmsConnectionModes","data.defDbConnection.DbmsConnectionModes"],[130,0,1,,"data.defDbConnection.DbmsConnectionModes.DMBS_DSNless"],[131,0,1,,"data.defDbConnection.DbmsConnectionModes.DMBS_DSN"],[132,0,1,,"data.defDbConnection.DbmsConnectionModes.DBMS_USERDEF"]]);
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/defDbConnection-bas-SummaryToolTips.js b/doc/ACLib-DbConnection-Framework/files/defDbConnection-bas-SummaryToolTips.js
new file mode 100644
index 0000000..268b3cc
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/defDbConnection-bas-SummaryToolTips.js
@@ -0,0 +1 @@
+NDSummary.OnToolTipsLoaded("File:defDbConnection.bas",{125:"
Set of global types, enums etc. for the DbConnection classes
",127:"
Type for the simultaneous transfer of the connection strings
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/defDbConnection-bas-ToolTips.js b/doc/ACLib-DbConnection-Framework/files/defDbConnection-bas-ToolTips.js
new file mode 100644
index 0000000..eddcd48
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/defDbConnection-bas-ToolTips.js
@@ -0,0 +1 @@
+NDContentPage.OnToolTipsLoaded({});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/defDbConnection-bas.html b/doc/ACLib-DbConnection-Framework/files/defDbConnection-bas.html
new file mode 100644
index 0000000..d48fda2
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/defDbConnection-bas.html
@@ -0,0 +1,34 @@
+
+
+defDbConnection.bas
+
+
+
+
+
+
+
+
+
data.defDbConnection
+
Set of global types, enums etc. for the DbConnection classes
+
+
+
+
Types
+
+
+
+
DbmsConnectionStrings
+
Type for the simultaneous transfer of the connection strings
OledbConnectionString
OLEDB connectionstring for ADODB connection
OdbcConnectionString
ODBC connectionstring for DAO connection
DatabaseFile
Database file name incl. path if a file backend is used
+
+
+
+
Enums
+
+
+
+
DbmsConnectionModes
+
DMBS_DSNless
(1) without DSN
DMBS_DSN
(2) with DSN
DBMS_USERDEF
(128) User-defined connection strings
+
+
+
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/modDbConnection-bas-Summary.js b/doc/ACLib-DbConnection-Framework/files/modDbConnection-bas-Summary.js
new file mode 100644
index 0000000..e4f0d3c
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/modDbConnection-bas-Summary.js
@@ -0,0 +1 @@
+NDFramePage.OnPageTitleLoaded("File:modDbConnection.bas","modDbConnection.bas");NDSummary.OnSummaryLoaded("File:modDbConnection.bas",[["Visual Basic","VisualBasic"]],[["Classes","Class"],["Functions","Function"],["Groups","Group"],["Properties","Property"]],[[116,0,0,"data.modDbConnection","data.modDbConnection"],[117,0,2,"Factories","data.modDbConnection.Factories"],[118,0,3,"DbCon","data.modDbConnection.DbCon"],[119,0,3,"CurrentConnectionInfo","data.modDbConnection.CurrentConnectionInfo"],[120,0,2,"Global Procedures","data.modDbConnection.Global_Procedures"],[121,0,1,"CheckConnectionStatus","data.modDbConnection.CheckConnectionStatus"],[122,0,1,"DisposeDbConnection","data.modDbConnection.DisposeDbConnection"],[123,0,1,"TableDefExists","data.modDbConnection.TableDefExists"],[124,0,1,"QueryDefExists","data.modDbConnection.QueryDefExists"]]);
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/modDbConnection-bas-SummaryToolTips.js b/doc/ACLib-DbConnection-Framework/files/modDbConnection-bas-SummaryToolTips.js
new file mode 100644
index 0000000..945e787
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/modDbConnection-bas-SummaryToolTips.js
@@ -0,0 +1 @@
+NDSummary.OnToolTipsLoaded("File:modDbConnection.bas",{116:"
Collection of procedures for the DbConnectionManager class
",118:"
Access to DbConnection of the main DbConnectionManager instance
",119:"
Access to DbConnectionInfo of the main DbConnectionManager instance
",121:"
Public Function CheckConnectionStatus() As Boolean
Verbindung prüfen (call data.DbConnectionManager.CheckConnectionStatus)
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/modDbConnection-bas-ToolTips.js b/doc/ACLib-DbConnection-Framework/files/modDbConnection-bas-ToolTips.js
new file mode 100644
index 0000000..f0523f6
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/modDbConnection-bas-ToolTips.js
@@ -0,0 +1 @@
+NDContentPage.OnToolTipsLoaded({145:"
Public Function CheckConnectionStatus() As Boolean
Test whether a connection can be established
",150:"
Auxiliary class for setting the connection parameters
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/modDbConnection-bas.html b/doc/ACLib-DbConnection-Framework/files/modDbConnection-bas.html
new file mode 100644
index 0000000..34c0b54
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/modDbConnection-bas.html
@@ -0,0 +1,58 @@
+
+
+modDbConnection.bas
+
+
+
+
+
+
+
+
+
data.modDbConnection
+
Collection of procedures for the DbConnectionManager class
Remarks
Used to instantiate DbConnectionManager and access the main elements of DbConnectionManager.</remarks>
+
+
+
+
Factories
+
+
+
+
DbCon
+
Access to DbConnection of the main DbConnectionManager instance
Returns
DbConnectionHandler
Remarks
Simplifies the call, as the writing of the DbConnectionManager instance variables is omitted. The first access creates the instance of the DbConnectionManager class if it does not already exist.
+
+
+
+
CurrentConnectionInfo
+
Access to DbConnectionInfo of the main DbConnectionManager instance
Simplifies the call, as the writing of the DbConnectionManager instance variables is omitted. The first access creates the instance of the DbConnectionManager class if it does not already exist.
+
+
+
+
Global Procedures
+
+
+
+
CheckConnectionStatus
+
Public Function CheckConnectionStatus() As Boolean
(DAO.Database) Database to use (optional: if nothing CurrentDb will be used)
+
+
+
+
QueryDefExists
+
Public Function QueryDefExists(
ByVal QueryDefName
As
String,
Optional ByVal db
As
DAO.Database
=
Nothing
) As Boolean
+
Check if QueryDef exists
Parameters
QueryDefName
(String) QueryDef name
db
(DAO.Database) Database to use (optional: if nothing CurrentDb will be used)
+
+
+
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/odbc/OdbcHandler-cls-Summary.js b/doc/ACLib-DbConnection-Framework/files/odbc/OdbcHandler-cls-Summary.js
new file mode 100644
index 0000000..79c5b41
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/odbc/OdbcHandler-cls-Summary.js
@@ -0,0 +1 @@
+NDFramePage.OnPageTitleLoaded("File:odbc/OdbcHandler.cls","OdbcHandler.cls");NDSummary.OnSummaryLoaded("File:odbc/OdbcHandler.cls",[["Visual Basic","VisualBasic"]],[["Classes","Class"],["Events","Event"],["Functions","Function"],["Groups","Group"],["Properties","Property"]],[[45,0,0,"data.odbc.OdbcHandler","data.odbc.OdbcHandler"],[46,0,3,"Events","data.odbc.OdbcHandler.Events"],[47,0,1,"ErrorMissingCurrentDb","data.odbc.OdbcHandler.ErrorMissingCurrentDb"],[48,0,1,"ErrorEmptyConnectionString","data.odbc.OdbcHandler.ErrorEmptyConnectionString"],[49,0,1,"DbObjectRelinked","data.odbc.OdbcHandler.DbObjectRelinked"],[50,0,1,"DbObjectDeleted","data.odbc.OdbcHandler.DbObjectDeleted"],[51,0,1,"HookInsertIdentityReturn","data.odbc.OdbcHandler.HookInsertIdentityReturn"],[52,0,3,"Class control","data.odbc.OdbcHandler.Class_control"],[53,0,4,"HooksEnabled","data.odbc.OdbcHandler.HooksEnabled"],[54,0,3,"Data Connection","data.odbc.OdbcHandler.Data_Connection"],[55,0,4,"CurrentDb","data.odbc.OdbcHandler.CurrentDb"],[56,0,4,"CurrentDbBE","data.odbc.OdbcHandler.CurrentDbBE"],[57,0,4,"ConnectionString","data.odbc.OdbcHandler.ConnectionString"],[58,0,2,"OpenRecordset","data.odbc.OdbcHandler.OpenRecordset"],[59,0,2,"OpenRecordsetPT","data.odbc.OdbcHandler.OpenRecordsetPT"],[60,0,2,"Execute","data.odbc.OdbcHandler.Execute"],[61,0,2,"ExecutePT","data.odbc.OdbcHandler.ExecutePT"],[62,0,2,"LookupSQL","data.odbc.OdbcHandler.LookupSQL"],[63,0,2,"LookupSqlPT","data.odbc.OdbcHandler.LookupSqlPT"],[64,0,2,"Lookup","data.odbc.OdbcHandler.Lookup"],[65,0,2,"Count","data.odbc.OdbcHandler.Count"],[66,0,2,"Max","data.odbc.OdbcHandler.Max"],[67,0,2,"Min","data.odbc.OdbcHandler.Min"],[68,0,2,"Sum","data.odbc.OdbcHandler.Sum"],[69,0,2,"InsertIdentityReturn","data.odbc.OdbcHandler.InsertIdentityReturn"],[70,0,3,"Linked Table Support","data.odbc.OdbcHandler.Linked_Table_Support"],[71,0,2,"LinkTable","data.odbc.OdbcHandler.LinkTable"],[72,0,2,"RelinkTables","data.odbc.OdbcHandler.RelinkTables"],[73,0,2,"RelinkTable","data.odbc.OdbcHandler.RelinkTable"],[74,0,2,"RelinkPassThroughQueries","data.odbc.OdbcHandler.RelinkPassThroughQueries"],[75,0,2,"RelinkPassThroughQuery","data.odbc.OdbcHandler.RelinkPassThroughQuery"],[76,0,2,"RelinkTablesAndQueries","data.odbc.OdbcHandler.RelinkTablesAndQueries"],[77,0,2,"DeleteOdbcTableDefs","data.odbc.OdbcHandler.DeleteOdbcTableDefs"],[78,0,2,"IsLinkedTable","data.odbc.OdbcHandler.IsLinkedTable"],[79,0,2,"IsPassThroughQuery","data.odbc.OdbcHandler.IsPassThroughQuery"]]);
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/odbc/OdbcHandler-cls-SummaryToolTips.js b/doc/ACLib-DbConnection-Framework/files/odbc/OdbcHandler-cls-SummaryToolTips.js
new file mode 100644
index 0000000..e27bb49
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/odbc/OdbcHandler-cls-SummaryToolTips.js
@@ -0,0 +1 @@
+NDSummary.OnToolTipsLoaded("File:odbc/OdbcHandler.cls",{45:"
ODBC data connection methods
",47:"
Event for missing CurrentDb reference
",48:"
Event for missing ODBC connection string
",49:"
Info about the last linked element
",50:"
Info about the last deleted element
",51:"
Event for missing OLEDB connection string
",53:"
Active Hooks
",55:"
DAO.Database-Instanz des Frontends bzw. jener Jet-DB in der die Pass-Through-Abfragen erstellt werden sollen
",56:"
Database-Referenz zum Backend
",57:"
ODBC Connection string
",58:"
Public Function OpenRecordset(
ByVal Source
As
String,
Optional ByVal RecordsetType
As
DAO.RecordsetTypeEnum
=
dbOpenForwardOnly,
Optional ByVal RecordsetOptions
As
DAO.RecordsetOptionEnum
=
DAO.RecordsetOptionEnum.dbSeeChanges,
Optional ByVal LockEdit
As
DAO.LockTypeEnum
=
DAO.LockTypeEnum.dbOptimistic
) As DAO.Recordset
Open DAO.Recordset
",59:"
Public Function OpenRecordsetPT(
ByVal Source
As
String,
Optional ByVal RecordsetType
As
DAO.RecordsetTypeEnum
=
dbOpenForwardOnly,
Optional ByVal RecordsetOptions
As
DAO.RecordsetOptionEnum
=
DAO.RecordsetOptionEnum.dbSeeChanges Or DAO.RecordsetOptionEnum.dbSQLPassThrough,
Optional ByVal LockEdit
As
DAO.LockTypeEnum
=
DAO.LockTypeEnum.dbOptimistic
) As DAO.Recordset
Open Pass Through DAO.Recordset
",60:"
Public Function Execute(
ByVal CommandText
As
String,
Optional ByVal Options
As
DAO.RecordsetOptionEnum
) As Long
Execute SQL statement (CurrentDbBE.Execute)
",61:"
Public Function ExecutePT(
ByVal CommandText
As
String,
Optional ByVal Options
As
DAO.RecordsetOptionEnum
=
DAO.RecordsetOptionEnum.dbSQLPassThrough
) As Long
Execute SQL statement with Pass Trough Query
",62:"
Public Function LookupSql(
ByVal SqlText
As
String,
Optional ByVal Index
As
Variant
=
0&,
Optional ByVal ValueIfNull
As
Variant
=
Null
) As Variant
Lookup DAO.Recordset replacement function for DLookup (passing a SQL statement) via CurrentDbBE
",63:"
Public Function LookupSqlPT(
ByVal SqlText
As
String,
Optional ByVal Index
As
Variant
=
0&,
Optional ByVal ValueIfNull
As
Variant
=
Null
) As Variant
Lookup DAO.Recordset replacement function for DLookup (passing a SQL statement) via Pass Through Query
",64:"
Public Function Lookup(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant,
Optional ByVal ValueIfNull
As
Variant
=
Null
) As Variant
DAO.Recordset replacement function for DLookup (via CurrentDbBE)
",65:"
Public Function Count(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
DAO.Recordset replacement function for DCount (via CurrentDbBE)
",66:"
Public Function Max(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
DAO.Recordset replacement function for DMax (via CurrentDbBE)
",67:"
Public Function Min(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
DAO.Recordset replacement function for DMin (via CurrentDbBE)
",68:"
Public Function Sum(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
DAO.Recordset replacement function for DSum (via CurrentDbBE)
",69:"
Public Function InsertIdentityReturn(
ByVal InsertSql
As
String
) As Variant
Execute insert SQL statement and return last identity value (via CurrentDbBE)
",71:"
Public Sub LinkTable(
ByVal SourceTableName
As
String,
Optional ByVal LinkedTableName
As
String
=
vbNullString,
Optional ByVal SavePWD
As
Boolean
=
False,
Optional ByVal RemoveSchemaName
As
Boolean
=
True
)
Link backend table in Access frontend
",72:"
Public Function RelinkTables(
Optional ByVal SavePWD
As
Boolean
=
False,
Optional ByVal EventPeriod
As
Long
=
0
) As Long
Relink existing tables
",73:"
Public Function RelinkTable(
ByVal LinkedTableName
As
String,
Optional ByVal SavePWD
As
Boolean
=
False
) As Boolean
Relink linked table with possible change of server data
",74:"
Public Function RelinkPassThroughQueries(
Optional ByVal SavePWD
As
Boolean
=
False,
Optional ByVal EventPeriod
As
Long
=
0
) As Long
Alle Pass-Through-Abfragen neu verknüpfen
",75:"
Public Function RelinkPassThroughQuery(
ByVal QueryName
As
String,
Optional ByVal SavePWD
As
Boolean
=
False
) As Boolean
Relink pass through query
",76:"
Public Function RelinkTablesAndQueries(
Optional ByVal SavePWD
As
Boolean
=
False,
Optional ByVal EventPeriod
As
Long
=
0
) As Long
Relink all linked tables and pass-through queries
",77:"
Public Function DeleteOdbcTableDefs(
Optional ByVal EventPeriod
As
Long
=
0
) As Long
Delete all linked table in the frontend. (Has no effect on the backend tables).
",78:"
Public Function IsLinkedTable(
ByVal TableToCheck
As
DAO.TableDef
) As Boolean
Check if TableDef is a linked table
",79:"
Public Function IsPassThroughQuery(
ByVal QueryToCheck
As
DAO.QueryDef
) As Boolean
Check if QueryDef is a pass through query
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/odbc/OdbcHandler-cls-ToolTips.js b/doc/ACLib-DbConnection-Framework/files/odbc/OdbcHandler-cls-ToolTips.js
new file mode 100644
index 0000000..c68a69e
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/odbc/OdbcHandler-cls-ToolTips.js
@@ -0,0 +1 @@
+NDContentPage.OnToolTipsLoaded({56:"
Database-Referenz zum Backend
",57:"
ODBC Connection string
"});
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/files/odbc/OdbcHandler-cls.html b/doc/ACLib-DbConnection-Framework/files/odbc/OdbcHandler-cls.html
new file mode 100644
index 0000000..e53e948
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/files/odbc/OdbcHandler-cls.html
@@ -0,0 +1,203 @@
+
+
+OdbcHandler.cls
+
+
+
+
+
+
+
+
+
data.odbc.OdbcHandler
+
ODBC data connection methods
Author
Josef Poetzl
+
+
+
+
Events
+
+
+
+
ErrorMissingCurrentDb
+
Event for missing CurrentDb reference
Parameters
Msg
Message about the cause of the event triggering. (Not yet used)
NewCurrentDbRef
DAO.Database reference to be used for CurrentDb
Remarks
The required DAO.Database reference can be passed on via the ByRef parameter NewCurrentDbRef.
+
+
+
+
ErrorEmptyConnectionString
+
Event for missing ODBC connection string
Parameters
Msg
Message about the cause of the event triggering. (Not yet used)
NewConnectionString
ODBC Connectionstring
Remarks
The appropriate ODBC connection string can be passed on via the ByRef parameter NewConnectionString.
+
+
+
+
DbObjectRelinked
+
Info about the last linked element
Parameters
LastDbObjectName
the last linked table or view
Counter
Number of linked elements since the method was called
Remarks
Used in the RelinkTablesAndQueries method.
+
+
+
+
DbObjectDeleted
+
Info about the last deleted element
Parameters
LastDbObjectName
the last deleted table or view
Counter
Number of deleted elements since the method was called
Remarks
Used in the RelinkTablesAndQueries method.
+
+
+
+
HookInsertIdentityReturn
+
Event for missing OLEDB connection string
Parameters
InsertSql
SQL text of insert statement
ActiveDb
ADODB Connection to use
IdentitySelectString
Input string to use
HookResponseMode
resume action after event call: 0 ... code resume after event, 1 exit function after event
HookResponseMessage
return value of function (e.g. InsertIdentityReturn) when HookResponseMode <> 0
Remarks
New values can be passed on via the ByRef parameters.
+
+
+
+
Class control
+
+
+
+
HooksEnabled
+
Active Hooks
Remarks
Used in InsertIdentityReturn
+
+
+
+
Data Connection
+
+
+
+
CurrentDb
+
DAO.Database-Instanz des Frontends bzw. jener Jet-DB in der die Pass-Through-Abfragen erstellt werden sollen
+
+
+
+
CurrentDbBE
+
Database-Referenz zum Backend
Remarks DAO.Database wird über DBEngine.OpenDatabase("", dbDriverComplete, False, ConnectionString) geöffnet.
Lookup DAO.Recordset replacement function for DLookup (passing a SQL statement) via CurrentDbBE
Parameters
SqlText
SQL statement
Index
Field selection if the first field of the recordset is not to be returned. The index is passed in the same way as ADODB.Recordset.Fields(index).
ValueIfNull
Return value if record is missing or data field value is Null (default: Null).
Returns
Variant
Null, if SQL statement does not return a record.
Remarks
The SQL statement must be written in the Jet/ACE SQL dialect.
+
+
+
+
LookupSqlPT
+
Public Function LookupSqlPT(
ByVal SqlText
As
String,
Optional ByVal Index
As
Variant
=
0&,
Optional ByVal ValueIfNull
As
Variant
=
Null
) As Variant
+
Lookup DAO.Recordset replacement function for DLookup (passing a SQL statement) via Pass Through Query
Parameters
SqlText
SQL statement
Index
Field selection if the first field of the recordset is not to be returned. The index is passed in the same way as ADODB.Recordset.Fields(index).
ValueIfNull
Return value if record is missing or data field value is Null (default: Null).
Returns
Variant
Null, if SQL statement does not return a record.
Remarks
The SQL statement must be written in the SQL dialect of backend (e. g. T-SQL for SQL-Server)
+
+
+
+
Lookup
+
Public Function Lookup(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant,
Optional ByVal ValueIfNull
As
Variant
=
Null
) As Variant
+
DAO.Recordset replacement function for DLookup (via CurrentDbBE)
Parameters
Expr
Field name or calculated expression (select part)
Domain
Table, query or SQL expression for sub-query (FROM part)
Criteria
(Optional) Criteria string (WHERE part)
ValueIfNull
Return value if record is missing or data field value is Null (default: Null).
Returns
Variant
+
+
+
+
Count
+
Public Function Count(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
+
DAO.Recordset replacement function for DCount (via CurrentDbBE)
Parameters
Expr
Field name or calculated expression (select part)
Domain
Table, query or SQL expression for sub-query (FROM part)
Criteria
(optional) Criteria string (WHERE part)
Returns
Long
+
+
+
+
Max
+
Public Function Max(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
+
DAO.Recordset replacement function for DMax (via CurrentDbBE)
Parameters
Expr
Field name or calculated expression (select part)
Domain
Table, query or SQL expression for sub-query (FROM part)
Criteria
(Optional) Criteria string (WHERE part)
Returns
Variant
+
+
+
+
Min
+
Public Function Min(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
+
DAO.Recordset replacement function for DMin (via CurrentDbBE)
Parameters
Expr
Field name or calculated expression (select part)
Domain
Table, query or SQL expression for sub-query (FROM part)
Criteria
(Optional) Criteria string (WHERE part)
Returns
Variant
+
+
+
+
Sum
+
Public Function Sum(
ByVal Expr
As
String,
ByVal Domain
As
String,
Optional ByVal Criteria
As
Variant
) As Variant
+
DAO.Recordset replacement function for DSum (via CurrentDbBE)
Parameters
Expr
Field name or calculated expression (select part)
Domain
Table, query or SQL expression for sub-query (FROM part)
Criteria
(Optional) Criteria string (WHERE part)
Returns
Variant
+
+
+
+
InsertIdentityReturn
+
Public Function InsertIdentityReturn(
ByVal InsertSql
As
String
) As Variant
+
Execute insert SQL statement and return last identity value (via CurrentDbBE)
Parameters
InsertSQL
Insert SQL statement
Returns
Identity value or NULL if no record was appended
Remarks
Works for Jet only from Jet 4.0 (Access 2000), IdentityTable is only applicable for MSSQL, under MySQL the IDENT_CURRENT function does not exist. If HooksEnabled: event HookInsertIdentityReturn will be raised
+
+
+
+
Linked Table Support
+
+
+
+
LinkTable
+
Public Sub LinkTable(
ByVal SourceTableName
As
String,
Optional ByVal LinkedTableName
As
String
=
vbNullString,
Optional ByVal SavePWD
As
Boolean
=
False,
Optional ByVal RemoveSchemaName
As
Boolean
=
True
)
+
Link backend table in Access frontend
Parameters
SourceTableName
Table or view in the backend
LinkedTableName
Table in frontend
SavePWD
Save ODBC password in linked table
RemoveSchemaName
Remove schema identifier
Remarks
If there is a 2-part table identifier like "dbo.Table123" in the BE and bRemoveSchemaName is set to false, the dot is replaced by "_".
+
+
+
+
RelinkTables
+
Public Function RelinkTables(
Optional ByVal SavePWD
As
Boolean
=
False,
Optional ByVal EventPeriod
As
Long
=
0
) As Long
+
Relink existing tables
Parameters
SavePWD
Save ODBC password in linked table
EventPeriod
Number of linked elements when the DbObjectRelinked event is to be called. (Default: 0 ... no event call).
Returns
Long
Number of linked tables
+
+
+
+
RelinkTable
+
Public Function RelinkTable(
ByVal LinkedTableName
As
String,
Optional ByVal SavePWD
As
Boolean
=
False
) As Boolean
+
Relink linked table with possible change of server data
Parameters
LinkedTableName
Table in frontend
SavePWD
Save ODBC password in linked table
Returns
Boolean
success
Remarks
The TableDef property SourceTableName is not changed.
+
+
+
+
RelinkPassThroughQueries
+
Public Function RelinkPassThroughQueries(
Optional ByVal SavePWD
As
Boolean
=
False,
Optional ByVal EventPeriod
As
Long
=
0
) As Long
+
Alle Pass-Through-Abfragen neu verknüpfen
Parameters
SavePWD
Save ODBC password in linked table
EventPeriod
Number of linked elements when the DbObjectRelinked event is to be called. (Default: 0 ... no event call).
Returns
Long
Number of linked pass through queries
+
+
+
+
RelinkPassThroughQuery
+
Public Function RelinkPassThroughQuery(
ByVal QueryName
As
String,
Optional ByVal SavePWD
As
Boolean
=
False
) As Boolean
+
Relink pass through query
Parameters
QueryName
Table in frontend
SavePWD
Save ODBC password in pass throug query
Returns
Boolean
success
+
+
+
+
RelinkTablesAndQueries
+
Public Function RelinkTablesAndQueries(
Optional ByVal SavePWD
As
Boolean
=
False,
Optional ByVal EventPeriod
As
Long
=
0
) As Long
+
Relink all linked tables and pass-through queries
Parameters
SavePWD
Save ODBC password in linked table
EventPeriod
Number of linked elements when the DbObjectRelinked event is to be called. (Default: 0 ... no event call).
Returns
Long
Number of linked tables and queries
+
+
+
+
DeleteOdbcTableDefs
+
Public Function DeleteOdbcTableDefs(
Optional ByVal EventPeriod
As
Long
=
0
) As Long
+
Delete all linked table in the frontend. (Has no effect on the backend tables).
Parameters
EventPeriod
Number of linked elements when the DbObjectRelinked event is to be called. (Default: 0 ... no event call).
Returns
Long
Number of deleted tables
Remarks
Depending on the setting of EventPeriod the event DbObjectDeleted is triggered
+
+
+
+
IsLinkedTable
+
Public Function IsLinkedTable(
ByVal TableToCheck
As
DAO.TableDef
) As Boolean
+
Check if TableDef is a linked table
Parameters
TableToCheck
TableDef reference to Access table in frontend
Returns
Boolean
+
+
+
+
IsPassThroughQuery
+
Public Function IsPassThroughQuery(
ByVal QueryToCheck
As
DAO.QueryDef
) As Boolean
+
Check if QueryDef is a pass through query
Parameters
QueryToCheck
QueryDef reference to Access query in frontend
Returns
Boolean
+
+
+
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/index.html b/doc/ACLib-DbConnection-Framework/index.html
new file mode 100644
index 0000000..8594780
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/index.html
@@ -0,0 +1,9 @@
+
+
+ACLib Database Connection Framework Documentation
+
+
+
+
+
+
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/menu/classes.js b/doc/ACLib-DbConnection-Framework/menu/classes.js
new file mode 100644
index 0000000..e1e407e
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/menu/classes.js
@@ -0,0 +1 @@
+NDMenu.OnSectionLoaded("classes.js",[[2,"adodb","VisualBasicClass:data.adodb.",[[1,"AdodbHandler"]]],[2,"dao","VisualBasicClass:data.dao.",[[1,"DaoHandler"]]],[1,"DbConnectionHandler"],[1,"DbConnectionInfo"],[1,"DbConnectionManager"],[1,"DbConnectionSettings"],[1,"defDbConnection"],[1,"modDbConnection"],[2,"odbc","VisualBasicClass:data.odbc.",[[1,"OdbcHandler"]]],[2,"sql","VisualBasicClass:data.sql.",[[1,"SqlTools"]]]]);
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/menu/files.js b/doc/ACLib-DbConnection-Framework/menu/files.js
new file mode 100644
index 0000000..6a56268
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/menu/files.js
@@ -0,0 +1 @@
+NDMenu.OnSectionLoaded("files.js",[[2,"ado","File:ado/",[[1,"AdodbHandler.cls"]]],[2,"dao","File:dao/",[[1,"DaoHandler.cls"]]],[1,"DbConnectionHandler.cls"],[1,"DbConnectionInfo.cls"],[1,"DbConnectionManager.cls"],[1,"DbConnectionSettings.cls"],[1,"defDbConnection.bas"],[1,"modDbConnection.bas"],[2,"odbc","File:odbc/",[[1,"OdbcHandler.cls"]]],[1,"SqlTools.cls"]]);
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/menu/tabs.js b/doc/ACLib-DbConnection-Framework/menu/tabs.js
new file mode 100644
index 0000000..8d7e0cf
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/menu/tabs.js
@@ -0,0 +1 @@
+NDFramePage.OnLocationsLoaded([["File","files",0,"^File([0-9]*)$"],["Class","classes",1,"^([A-Za-z]+)Class$"]]);NDMenu.OnTabsLoaded([["File","Files","File:","files.js"],["Class",["Classes","data"],"VisualBasicClass:data.","classes.js"]]);
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/other/home.html b/doc/ACLib-DbConnection-Framework/other/home.html
new file mode 100644
index 0000000..8da5499
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/other/home.html
@@ -0,0 +1,13 @@
+
+
+ACLib Database Connection Framework Documentation
+
+
+
+
+
+
+
+
"+entry[3];entryHTML.onmouseover=mouseOverHandler;entryHTML.onmouseout=mouseOutHandler;var entryHTMLChild=entryHTML.firstChild;if(entryHTMLChild!=undefined&&NDCore.HasClass(entryHTMLChild,"Qualifier")){entryHTMLChild.onmouseover=mouseOverHandler;entryHTMLChild.onmouseout=mouseOutHandler;}newContent.appendChild(entryHTML);}}}var summaryContainer=document.getElementById("NDSummary");var oldContent=document.getElementById("SuContent");if(oldContent!=undefined){summaryContainer.replaceChild(newContent,oldContent);}else{summaryContainer.appendChild(newContent);}newContent.scrollIntoView(true);if(this.summaryEntries!=undefined){NDFramePage.SizeSummaryToContent();}};this.FinishNavigation=function(){if(NDCore.CaseInsensitiveAnchors()&&this.summaryEntries!=undefined&&NDFramePage.currentLocation!=undefined&&NDFramePage.currentLocation.member!=undefined){var topicID=-1;for(var i=0;i0){return id;}else{return-1;}};this.ShowToolTip=function(){var entry=document.getElementById("SuEntry"+this.showingToolTip);this.toolTipHolder.innerHTML=this.summaryToolTips[this.showingToolTip];this.toolTipHolder.style.visibility="hidden";this.toolTipHolder.style.display="block";var summaryBlock=document.getElementById("NDSummary");var x=summaryBlock.offsetLeft+entry.offsetLeft+entry.offsetWidth;var y=summaryBlock.offsetTop+entry.offsetTop-summaryBlock.scrollTop;var newWidth=undefined;var maxWidth=window.innerWidth-x-5;if(this.toolTipHolder.offsetWidth>maxWidth){newWidth=maxWidth;}this.toolTipHolder.style.left=x+"px";this.toolTipHolder.style.top=y+"px";if(newWidth!=undefined){this.toolTipHolder.style.width=newWidth+"px";}var prototypes=this.toolTipHolder.getElementsByClassName("NDPrototype");if(prototypes.length>0&&NDCore.HasClass(prototypes[0],"WideForm")&&prototypes[0].scrollWidth>prototypes[0].offsetWidth){NDCore.ChangePrototypeToNarrowForm(prototypes[0]);}if(y+this.toolTipHolder.offsetHeight+25>window.innerHeight){var newY=window.innerHeight-this.toolTipHolder.offsetHeight-25;if(newY<0){newY=0;}this.toolTipHolder.style.top=newY+"px";}this.toolTipHolder.style.visibility="visible";};this.ResetToolTip=function(){if(this.showingToolTip!=undefined){this.toolTipHolder.style.display="none";this.toolTipHolder.style.width=null;this.lastToolTip=this.showingToolTip;this.showingToolTip=undefined;}if(this.toolTipTimeout!=undefined){clearTimeout(this.toolTipTimeout);this.toolTipTimeout=undefined;}};};
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/styles/main.css b/doc/ACLib-DbConnection-Framework/styles/main.css
new file mode 100644
index 0000000..464e7a3
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/styles/main.css
@@ -0,0 +1 @@
+@import URL("Default/Default.css");
\ No newline at end of file
diff --git a/doc/ACLib-DbConnection-Framework/styles/main.js b/doc/ACLib-DbConnection-Framework/styles/main.js
new file mode 100644
index 0000000..63ec71c
--- /dev/null
+++ b/doc/ACLib-DbConnection-Framework/styles/main.js
@@ -0,0 +1 @@
+"use strict";var NDLoader=new function(){this.JSLinks_All=["DefaultJS/NDCore.js"];this.JSLinks_Frame=["DefaultJS/NDFramePage.js","DefaultJS/NDMenu.js","DefaultJS/NDSummary.js","DefaultJS/NDSearch.js"];this.JSLinks_Content=["DefaultJS/NDContentPage.js"];this.JSLinks_Home=[];this.LoadJS=function(pageType,relativePrefix){this.LoadJSArray(this.JSLinks_All,relativePrefix);this.LoadJSArray(this['JSLinks_'+pageType],relativePrefix);};this.LoadJSArray=function(links,relativePrefix){if(navigator.userAgent.indexOf('KHTML')!=-1){for(var i=0;i');}}else{var head=document.getElementsByTagName('head')[0];for(var i=0;i m_ValueOnClassInit Then
- Application.SetOption ErrorTrappingOptionName, m_ValueOnClassInit
- End If
- End If
-End Sub
-
-Public Property Get KeepNewValueOnTerminate() As Boolean
- KeepNewValueOnTerminate = m_KeepNewValueOnTerminate
-End Property
-
-Public Property Let KeepNewValueOnTerminate(ByVal NewValue As Boolean)
- m_KeepNewValueOnTerminate = NewValue
-End Property
-
-Public Property Get ErrorTrapping() As VbaErrorTrappingOptions
- ErrorTrapping = Application.GetOption(ErrorTrappingOptionName)
-End Property
-
-Public Property Let ErrorTrapping(ByVal NewValue As VbaErrorTrappingOptions)
- If ErrorTrapping <> NewValue Then
- Application.SetOption ErrorTrappingOptionName, NewValue
- End If
-End Property
diff --git a/source/_config_Application.bas b/source/_config_Application.bas
index 871b720..301b77f 100644
--- a/source/_config_Application.bas
+++ b/source/_config_Application.bas
@@ -1,23 +1,23 @@
Attribute VB_Name = "_config_Application"
'
-'############################################################################
-'## ##
-'## Individuell gestaltete Config-Module nicht in das Repositiory laden! ##
-'## ##
-'############################################################################
+'#############################################################################
+'## ##
+'## Do not load individually designed config modules into the repository! ##
+'## ##
+'#############################################################################
'
'---------------------------------------------------------------------------------------
-' Modul: _config_Application (Beispiel)
+' Module: _config_Application
+'---------------------------------------------------------------------------------------
+'
+' Application configuration
+'
+' Remarks:
+' Do not load custom config modules into the repository.
+'
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
-'/**
-'
-' Beispiel für Anwendungskonfiguration
-'
-'
-' Indiviuell gestaltete Config-Module nicht in das Repositiory laden.
-'
-'\ingroup base
-'**/
'
' _codelib/license.bas
'
@@ -25,21 +25,16 @@ Attribute VB_Name = "_config_Application"
'
'---------------------------------------------------------------------------------------
'
-' Das Modul _config_Application wird vom Import-Assistenden nicht überschrieben.
-' Sollte eine neues _config_Application-Modul geladen werden,
-' ist das alte zuvor umzubennen oder zu löschen.
+' The _config_Application module is not overwritten by the import wizard.
+' If a new _config_Application module is loaded, the old one must be renamed or deleted first.
'
-'
-' Nicht vergessen: USELOCALIZATION = 1 als Complier-Arg. in Projekteigenschaft einstellen
+' Do not forget: Set USELOCALIZATION = 1 as complier argument in project property.
'
Option Compare Text
Option Explicit
Option Private Module
-'/** \addtogroup base
-'@{ **/
-
Private Const APPLICATION_VERSION As String = DCW_Version
#Const USE_CLASS_APPLICATIONHANDLER_APPFILE = 1
diff --git a/source/codelib/_codelib/addins/shared/ACLibGitHubImporter.cls b/source/codelib/_codelib/addins/shared/ACLibGitHubImporter.cls
index 69d19e9..97ff63d 100644
--- a/source/codelib/_codelib/addins/shared/ACLibGitHubImporter.cls
+++ b/source/codelib/_codelib/addins/shared/ACLibGitHubImporter.cls
@@ -8,16 +8,16 @@ Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'---------------------------------------------------------------------------------------
-' Klassenmodul: ACLibGitHubImporter
+' Class: _codelib.addins.shared.ACLibGitHubImporter
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Import GitHub files
-'
-'
-'
-'\ingroup addins_shared
-'**/
+'
+' Author:
+' Josef Poetzl
+'
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
'
' _codelib/addins/shared/ACLibGitHubImporter.cls
@@ -28,8 +28,8 @@ Attribute VB_Exposed = False
Option Compare Database
Option Explicit
-Const GitHubContentBaseUrl As String = "https://raw.githubusercontent.com/AccessCodeLib/AccessCodeLib/{branch}/{path}"
-Const GitHubApiBaseUrl As String = "https://api.github.com/repos/AccessCodeLib/AccessCodeLib/"
+Private Const GitHubContentBaseUrl As String = "https://raw.githubusercontent.com/AccessCodeLib/AccessCodeLib/{branch}/{path}"
+Private Const GitHubApiBaseUrl As String = "https://api.github.com/repos/AccessCodeLib/AccessCodeLib/"
Private m_LastCommit As Date
Private m_UseDraftBranch As Boolean
@@ -42,6 +42,9 @@ Private Declare Function DeleteUrlCacheEntry Lib "wininet.dll" Alias "DeleteUrlC
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
#End If
+'---------------------------------------------------------------------------------------
+' Property: UseDraftBranch
+'---------------------------------------------------------------------------------------
Public Property Get UseDraftBranch() As Boolean
UseDraftBranch = m_UseDraftBranch
End Property
@@ -50,6 +53,9 @@ Public Property Let UseDraftBranch(ByVal NewValue As Boolean)
m_UseDraftBranch = NewValue
End Property
+'---------------------------------------------------------------------------------------
+' Property: RevisionString
+'---------------------------------------------------------------------------------------
Public Property Get RevisionString(Optional ByVal Requery As Boolean = False) As String
RevisionString = Format(LastCommit, "yyyymmddhhnnss")
If UseDraftBranch Then
@@ -57,6 +63,9 @@ Public Property Get RevisionString(Optional ByVal Requery As Boolean = False) As
End If
End Property
+'---------------------------------------------------------------------------------------
+' Property: LastCommit
+'---------------------------------------------------------------------------------------
Public Property Get LastCommit(Optional ByVal Requery As Boolean = False) As String
If m_LastCommit = 0 Or Requery Then
m_LastCommit = GetLastCommitFromWeb()
@@ -64,6 +73,9 @@ Public Property Get LastCommit(Optional ByVal Requery As Boolean = False) As Str
LastCommit = m_LastCommit
End Property
+'---------------------------------------------------------------------------------------
+' Sub: UpdateCodeModules
+'---------------------------------------------------------------------------------------
Public Sub UpdateCodeModules()
Dim SelectSql As String
diff --git a/source/codelib/_codelib/addins/shared/AppFileCodeModulTransfer.cls b/source/codelib/_codelib/addins/shared/AppFileCodeModulTransfer.cls
index 046ad6f..41b4f0f 100644
--- a/source/codelib/_codelib/addins/shared/AppFileCodeModulTransfer.cls
+++ b/source/codelib/_codelib/addins/shared/AppFileCodeModulTransfer.cls
@@ -8,15 +8,16 @@ Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'---------------------------------------------------------------------------------------
-' Klasse: AppFileCodeModulTransfer
+' Class: _codelib.addins.shared.AppFileCodeModulTransfer
'---------------------------------------------------------------------------------------
-'/**
-' \author Josef Poetzl
-'
-' Codemodule aus AppFile-Tabelle importieren
-'
-'
-'**/
+'
+' Import codemodules from AppFile table
+'
+' Author:
+' Josef Poetzl
+'
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
'
' _codelib/addins/shared/AppFileCodeModulTransfer.cls
@@ -40,6 +41,9 @@ Private m_CurrentVbProject As Object
Private m_CodeModuleWriter As CodeModuleWriter
Private m_UseVbComponentsImport As Boolean
+'---------------------------------------------------------------------------------------
+' Property: UseVbComponentsImport
+'---------------------------------------------------------------------------------------
Public Property Get UseVbComponentsImport() As Boolean
UseVbComponentsImport = m_UseVbComponentsImport
End Property
@@ -49,41 +53,59 @@ Public Property Let UseVbComponentsImport(ByVal NewValue As Boolean)
End Property
-'Module u. Klassen übertragen
-Public Sub TransferCodeModules(ParamArray ModulNames() As Variant)
+'---------------------------------------------------------------------------------------
+' Sub: TransferCodeModules
+'---------------------------------------------------------------------------------------
+'
+' Transfer modules & classes
+'
+' Parameters:
+' CodeModulNames - (ParamArray) Name of CodeModule(s) to transfer
+'
+'---------------------------------------------------------------------------------------
+Public Sub TransferCodeModules(ParamArray CodeModulNames() As Variant)
Dim i As Long
Dim ArrSize As Long
- ArrSize = UBound(ModulNames)
+ ArrSize = UBound(CodeModulNames)
For i = 0 To ArrSize
- CheckCodeModule ModulNames(i), True
+ CheckCodeModule CodeModulNames(i), True
Next
End Sub
-'Module u. Klassen erneuern
-Public Function ReplaceCodeModules(ParamArray ModulNames() As Variant) As Boolean
+'---------------------------------------------------------------------------------------
+' Function: ReplaceCodeModules
+'---------------------------------------------------------------------------------------
+'
+' Renew modules & classes
+'
+' Parameters:
+' CodeModulNames - (ParamArray) Name of CodeModule(s) to renew
+'
+'---------------------------------------------------------------------------------------
+Public Function ReplaceCodeModules(ParamArray CodeModulNames() As Variant) As Boolean
Dim i As Long
Dim ArrSize As Long
Dim vbp As Object 'VBProject
- 'VBProject der Anwendung:
+ 'VBProject of the application:
Set vbp = VbeTools.CurrentVbProject
- 'Module erneuern:
+ 'Renew modules:
If Not (vbp Is Nothing) Then
- ArrSize = UBound(ModulNames)
+ ArrSize = UBound(CodeModulNames)
For i = 0 To ArrSize
- If CheckCodeModule(ModulNames(i)) And (UseVbComponentsImport = False) Then
+ If CheckCodeModule(CodeModulNames(i)) And (UseVbComponentsImport = False) Then
'Modul löschen
- vbp.VBComponents.Remove vbp.VBComponents(ModulNames(i))
+ vbp.VBComponents.Remove vbp.VBComponents(CodeModulNames(i))
End If
'Module aktualisieren
- TransferCodeModul CurrentProject, acModule, ModulNames(i)
+ TransferCodeModul CurrentProject, acModule, CodeModulNames(i)
Next
ReplaceCodeModules = True
@@ -93,38 +115,62 @@ Public Function ReplaceCodeModules(ParamArray ModulNames() As Variant) As Boolea
End Function
-
-'Module u. Klassen auf Existenz prüfen. Es erfolgt keine inhaltliche Prüfung!
-Public Function CheckCodeModules(ParamArray ModulNames() As Variant) As Boolean
+'---------------------------------------------------------------------------------------
+' Function: CheckCodeModules
+'---------------------------------------------------------------------------------------
+'
+' Check modules and classes for existence.
+'
+' Parameters:
+' CodeModulNames - (ParamArray) Name of CodeModule(s) to check
+'
+' Remarks:
+' There is no content check.
+'
+'---------------------------------------------------------------------------------------
+Public Function CheckCodeModules(ParamArray CodeModulNames() As Variant) As Boolean
Dim i As Long
Dim ModulesExists As Boolean
Dim ArrSize As Long
- ArrSize = UBound(ModulNames)
+ ArrSize = UBound(CodeModulNames)
ModulesExists = True
For i = 0 To ArrSize
- ModulesExists = ModulesExists And CheckCodeModule(ModulNames(i), False)
+ ModulesExists = ModulesExists And CheckCodeModule(CodeModulNames(i), False)
Next
CheckCodeModules = ModulesExists
End Function
-'Modul oder Klasse auf Existenz prüfen. Es erfolgt keine inhaltliche Prüfung!
-Public Function CheckCodeModule(ByVal ModulName As String, _
+'---------------------------------------------------------------------------------------
+' Function: CheckCodeModule
+'---------------------------------------------------------------------------------------
+'
+' Check codemodule for existence.
+'
+' Parameters:
+' CodeModulName - Name of CodeModule to check
+' TransferMissingModule - Insert CodeModule if missing
+'
+' Remarks:
+' There is no content check.
+'
+'---------------------------------------------------------------------------------------
+Public Function CheckCodeModule(ByVal CodeModulName As String, _
Optional ByVal TransferMissingModule As Boolean = False) As Boolean
Dim rst As DAO.Recordset
Dim IsMissing As Boolean
- Set rst = CurrentDb.OpenRecordset("Select O.Name from MSysObjects O where O.Name = '" & ModulName & "' and O.Type=-32761", dbOpenForwardOnly, dbReadOnly)
+ Set rst = CurrentDb.OpenRecordset("Select O.Name from MSysObjects O where O.Name = '" & CodeModulName & "' and O.Type=-32761", dbOpenForwardOnly, dbReadOnly)
IsMissing = rst.EOF
rst.Close
Set rst = Nothing
If IsMissing And TransferMissingModule Then
- TransferCodeModul CurrentProject, acModule, ModulName
+ TransferCodeModul CurrentProject, acModule, CodeModulName
IsMissing = False
End If
@@ -132,16 +178,28 @@ Public Function CheckCodeModule(ByVal ModulName As String, _
End Function
+'---------------------------------------------------------------------------------------
+' Sub: TransferCodeModul
+'---------------------------------------------------------------------------------------
+'
+' Check codemodule for existence.
+'
+' Parameters:
+' TargetProject - Access.CurrentProject of target application
+' ObjType - AcObjectType of CodeModule to transfer (e. g. acModule or acForm)
+' CodeModulName - Name of CodeModule to transfer
+'
+'---------------------------------------------------------------------------------------
Public Sub TransferCodeModul(ByVal TargetProject As Access.CurrentProject, _
- ByVal ObjType As AcObjectType, ByVal ModulName As String)
+ ByVal ObjType As AcObjectType, ByVal CodeModulName As String)
Dim FileName As String
FileName = FileTools.GetNewTempFileName
- CurrentApplication.CreateAppFile ModulName, FileName
+ CurrentApplication.CreateAppFile CodeModulName, FileName
If UseVbComponentsImport And ObjType = acModule Then
- If VbeTools.CodeModuleExists(ModulName) Then
- CurrentCodeModulWriter.ImportVbComponent 0, ModulName, FileName
+ If VbeTools.CodeModuleExists(CodeModulName) Then
+ CurrentCodeModulWriter.ImportVbComponent 0, CodeModulName, FileName
VbeTools.ActivateCurrentProject
On Error Resume Next ' Bei mde-Add-In weigert sich Access manchmal die eigentliche Anwendung zu kompilieren
TargetProject.Application.DoCmd.RunCommand acCmdCompileAndSaveAllModules
@@ -151,10 +209,10 @@ Public Sub TransferCodeModul(ByVal TargetProject As Access.CurrentProject, _
On Error GoTo 0
Else
ConvertToSaveAsTextFile FileName
- TargetProject.Application.LoadFromText ObjType, ModulName, FileName
+ TargetProject.Application.LoadFromText ObjType, CodeModulName, FileName
End If
Else
- TargetProject.Application.LoadFromText ObjType, ModulName, FileName
+ TargetProject.Application.LoadFromText ObjType, CodeModulName, FileName
End If
Kill FileName
diff --git a/source/codelib/_codelib/addins/shared/CodeModuleWriter.cls b/source/codelib/_codelib/addins/shared/CodeModuleWriter.cls
index fc88263..8f291c6 100644
--- a/source/codelib/_codelib/addins/shared/CodeModuleWriter.cls
+++ b/source/codelib/_codelib/addins/shared/CodeModuleWriter.cls
@@ -8,15 +8,16 @@ Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'---------------------------------------------------------------------------------------
-' Class Module: CodeModuleWriter
+' Class: CodeModuleWriter
'---------------------------------------------------------------------------------------
-'/**
-'
-' Code-Module erstellen
-'
-'
-'
-'**/
+'
+' Create CodeModules
+'
+' Author:
+' Josef Poetzl
+'
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
'
' _codelib/addins/shared/CodeModuleWriter.cls
@@ -28,10 +29,10 @@ Attribute VB_Exposed = False
Option Compare Database
Option Explicit
-#Const EARLYBINDING = 0
+#Const VBIDE_EARLYBINDING = 0
#Const DEBUGMODE = 0
-#If EARLYBINDING Then
+#If VBIDE_EARLYBINDING Then
Private m_CodeModule As VBIDE.CodeModule
Private m_CurrentVbProject As VBIDE.VBProject
#Else
@@ -57,16 +58,11 @@ Option Explicit
'---------------------------------------------------------------------------------------
' Property: CodeModule
'---------------------------------------------------------------------------------------
-'/**
-'
-' Code-Modul, das geändert werden soll
-'
-' VBIDE.CodeModule
-'
-'
-'**/
+'
+' CodeModule to be changed
+'
'---------------------------------------------------------------------------------------
-#If EARLYBINDING Then
+#If VBIDE_EARLYBINDING Then
Public Property Get CodeModule() As VBIDE.CodeModule
#Else
Public Property Get CodeModule() As Object
@@ -76,18 +72,7 @@ Public Property Get CodeModule() As Object
End Property
-'---------------------------------------------------------------------------------------
-' Property: CodeModule
-'---------------------------------------------------------------------------------------
-'/**
-'
-' Code-Modul, das geändert werden soll
-'
-'
-'
-'**/
-'---------------------------------------------------------------------------------------
-#If EARLYBINDING Then
+#If VBIDE_EARLYBINDING Then
Public Property Set CodeModule(ByVal NewRef As VBIDE.CodeModule)
#Else
Public Property Set CodeModule(ByVal NewRef As Object)
@@ -155,7 +140,7 @@ Private Function CreateEmptyEventProcedure(ByVal EventName As String, ByVal Obje
CreateEmptyEventProcedure = m_CodeModule.ProcBodyLine(ObjectName & "_" & EventName, vbext_pk_Proc)
End Function
-#If EARLYBINDING Then
+#If VBIDE_EARLYBINDING Then
Friend Property Set CurrentVbProject(ByVal NewRef As VBIDE.VBProject)
#Else
Friend Property Set CurrentVbProject(ByVal NewRef As Object)
@@ -163,13 +148,13 @@ Friend Property Set CurrentVbProject(ByVal NewRef As Object)
Set m_CurrentVbProject = NewRef
End Property
-#If EARLYBINDING Then
+#If VBIDE_EARLYBINDING Then
Friend Property Get CurrentVbProject() As VBIDE.VBProject
#Else
Friend Property Get CurrentVbProject() As Object
#End If
-#If EARLYBINDING Then
+#If VBIDE_EARLYBINDING Then
Dim Proj As VBProject
#Else
Dim Proj As Object
@@ -186,7 +171,7 @@ End Property
Public Sub ImportVbComponent(ByVal ComponentType As vbext_ComponentType, ByVal CodeModulName As String, ByVal ImportFile As String)
-#If EARLYBINDING = 1 Then
+#If VBIDE_EARLYBINDING = 1 Then
Dim VbcCol As VBIDE.VBComponents
Dim vbc As VBIDE.VBComponent
Dim cm As VBIDE.CodeModule
@@ -273,13 +258,13 @@ Private Function GetComponentTypeFromFile(ByVal FilePath As String) As vbext_Com
End Function
-#If EARLYBINDING = 1 Then
+#If VBIDE_EARLYBINDING = 1 Then
Private Sub DeleteClassHeaderLinesFromCodeModul(ByRef cm As CodeModule)
#Else
Private Sub DeleteClassHeaderLinesFromCodeModul(ByRef cm As Object)
#End If
'
-'Header sieht so aus:
+'Header looks like this:
'--
'VERSION 1.0 CLASS
'BEGIN
diff --git a/source/codelib/_codelib/addins/shared/VbeTools.cls b/source/codelib/_codelib/addins/shared/VbeTools.cls
index 1a806c1..477a780 100644
--- a/source/codelib/_codelib/addins/shared/VbeTools.cls
+++ b/source/codelib/_codelib/addins/shared/VbeTools.cls
@@ -7,17 +7,17 @@ Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
-'Attribute VB_PredeclaredId = True
'---------------------------------------------------------------------------------------
-' Class Module: VbeTools
+' Class: _codelib.addins.shared.VbeTools
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' VBE Programming Support
-'
-'
-'
-'**/
+'
+' Author:
+' Josef Poetzl
+'
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
'
' _codelib/addins/shared/VbeTools.cls
diff --git a/source/codelib/_codelib/addins/shared/modWizardCodeModulesData.bas b/source/codelib/_codelib/addins/shared/modWizardCodeModulesData.bas
index 2eedcc1..f323e7e 100644
--- a/source/codelib/_codelib/addins/shared/modWizardCodeModulesData.bas
+++ b/source/codelib/_codelib/addins/shared/modWizardCodeModulesData.bas
@@ -1,15 +1,15 @@
Attribute VB_Name = "modWizardCodeModulesData"
'---------------------------------------------------------------------------------------
-' Modul: modWizardCodeModulesData
+' Package: _codelib.addins.shared.modWizardCodeModulesData
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' SCC file data in usys_AppFiles
-'
-'
-'
-' \ingroup addins_shared
-'**/
+'
+' Author:
+' Josef Poetzl
+'
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
'
' _codelib/addins/shared/modWizardCodeModulesData.bas
diff --git a/source/codelib/api/winapi/WinApiFileInfo.cls b/source/codelib/api/winapi/WinApiFileInfo.cls
index d1d4641..36a9c7b 100644
--- a/source/codelib/api/winapi/WinApiFileInfo.cls
+++ b/source/codelib/api/winapi/WinApiFileInfo.cls
@@ -8,16 +8,16 @@ Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'---------------------------------------------------------------------------------------
-' Class: WinApiFileInfo
+' Class: api.winapi.WinApiFileInfo
'---------------------------------------------------------------------------------------
-'/**
-'
-' Dateiinformationen mit Win-API auslesen
-'
-'
-'
-'\ingroup WinAPI
-'**/
+'
+' Read file information with Win-API
+'
+' Author:
+' Josef Poetzl
+'
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
'
' api/winapi/WinApiFileInfo.cls
@@ -25,7 +25,7 @@ Attribute VB_Exposed = False
'
'---------------------------------------------------------------------------------------
'
-' Code basiert auf http://support.microsoft.com/kb/509493/
+' Code based on http://support.microsoft.com/kb/509493/
'
Option Compare Text
Option Explicit
@@ -103,6 +103,31 @@ Private Type FILEINFOOUT
ProductVersion As String
End Type
+'---------------------------------------------------------------------------------------
+' Function: GetFileVersion
+'---------------------------------------------------------------------------------------
+'
+' Determines the version of a file
+'
+' Parameters:
+' FilePath - full path to the file
+'
+' Returns:
+' Version identifier
+'
+' Remarks:
+' Useful for reading versions from dll files
+'
+'--------------------------------------------------------------------------------------
+Public Function GetFileVersion(ByVal FilePath As String) As String
+ Dim VerInfo As FILEINFOOUT
+ If GetVersion(FilePath, VerInfo) Then
+ GetFileVersion = VerInfo.FileVersion
+ Else
+ GetFileVersion = vbNullString
+ End If
+End Function
+
Private Function GetVersion(ByVal FilePath As String, _
ByRef GetFileInfo As FILEINFOOUT) As Boolean
@@ -151,26 +176,3 @@ Private Function GetVersion(ByVal FilePath As String, _
GetVersion = True
End Function
-
-'---------------------------------------------------------------------------------------
-' Function: GetFileVersion
-'---------------------------------------------------------------------------------------
-'/**
-'
-' Ermittelt die Version aus einer Datei
-'
-' vollständiger Pfad zur Datei
-' Versionskennung
-'
-' Nützlich zum Auslesen von Versionen aus dll-Dateien
-'
-'**/
-'---------------------------------------------------------------------------------------
-Public Function GetFileVersion(ByVal FilePath As String) As String
- Dim VerInfo As FILEINFOOUT
- If GetVersion(FilePath, VerInfo) Then
- GetFileVersion = VerInfo.FileVersion
- Else
- GetFileVersion = vbNullString
- End If
-End Function
diff --git a/source/codelib/api/winapi/WinApiLayoutTools.cls b/source/codelib/api/winapi/WinApiLayoutTools.cls
index 31aaeb5..ef80de9 100644
--- a/source/codelib/api/winapi/WinApiLayoutTools.cls
+++ b/source/codelib/api/winapi/WinApiLayoutTools.cls
@@ -8,16 +8,16 @@ Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'---------------------------------------------------------------------------------------
-' Module: WinApiLayoutTools
+' Class: api.winapi.WinApiLayoutTools
'---------------------------------------------------------------------------------------
-'/**
-'
-' WinAPI-Funktionen zur Layoutgestaltung
-'
-'
-'
-'\ingroup WinAPI
-'**/
+'
+' WinAPI functions for layout design
+'
+' Author:
+' Josef Poetzl
+'
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
'
' api/winapi/WinApiLayoutTools.cls
@@ -101,26 +101,23 @@ Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal DC As Long, ByVal Inde
'---------------------------------------------------------------------------------------
' Sub: SetBackColor
'---------------------------------------------------------------------------------------
-'/**
-'
-' Hintergrundfarbe eines Fensters einstellen
-'
-' Fenster-Handle
-' Farbnummer
-'
-'
-'
-'**/
+'
+' Set background color of a window
+'
+' Parameters:
+' Hwnd - Window handle
+' Color - Color number
+'
'---------------------------------------------------------------------------------------
Public Sub SetBackColor(ByVal Hwnd As LongPtr, ByVal Color As Long)
Dim NewBrush As LongPtr
- 'Brush erzeugen
+ 'Create Brush
NewBrush = CreateSolidBrush(Color)
- 'Brush zuweisen
+ 'Assign Brush
SetClassLong Hwnd, GCL_HBRBACKGROUND, NewBrush
- 'Fenster neuzeichnen (gesamtes Fenster inkl. Background)
+ 'Redraw window (entire window incl. background)
RedrawWindow Hwnd, ByVal 0&, ByVal 0&, RDW_INVALIDATE Or RDW_ERASE
End Sub
@@ -128,16 +125,15 @@ End Sub
'---------------------------------------------------------------------------------------
' Function: TwipsPerPixelX
'---------------------------------------------------------------------------------------
-'/**
-'
-' Breite eines Pixels in twips
-'
-'
-' Single
-'
-' http://support.microsoft.com/kb/94927/de
-'
-'**/
+'
+' Width of a pixel in twips
+'
+' Returns:
+' Single
+'
+' Remarks:
+' http://support.microsoft.com/kb/94927
+'
'---------------------------------------------------------------------------------------
Public Function TwipsPerPixelX() As Single
Dim DC As LongPtr
@@ -149,15 +145,15 @@ End Function
'---------------------------------------------------------------------------------------
' Function: TwipsPerPixelY
'---------------------------------------------------------------------------------------
-'/**
-'
-' Höhe eines Pixels in twips
-'
-' Single
-'
-' http://support.microsoft.com/kb/94927/de
-'
-'**/
+'
+' Height of a pixel in twips
+'
+' Returns:
+' Single
+'
+' Remarks:
+' http://support.microsoft.com/kb/94927
+'
'---------------------------------------------------------------------------------------
Public Function TwipsPerPixelY() As Single
Dim DC As LongPtr
@@ -169,15 +165,12 @@ End Function
'---------------------------------------------------------------------------------------
' Function: GetScrollbarWidth
'---------------------------------------------------------------------------------------
-'/**
-'
-' Breite der Bildlaufleiste
-'
-'
-' Single
-'
-'
-'**/
+'
+' Width of the scroll bar
+'
+' Returns:
+' Single
+'
'---------------------------------------------------------------------------------------
Public Function GetScrollbarWidth() As Single
GetScrollbarWidth = GetSystemMetrics(SM_CXVSCROLL) * TwipsPerPixelX
@@ -186,16 +179,18 @@ End Function
'---------------------------------------------------------------------------------------
' Function: GetTwipsFromPixel
'---------------------------------------------------------------------------------------
-'/**
-'
-' Rechnet Pixel in Twips um
-'
-' Anzahl der Pixel
-' Long
-'
-' GetTwipsFromPixel = TwipsPerPixelX * pixel
-'
-'**/
+'
+' Converts pixels to twips
+'
+' Parameters:
+' Pixel - Number of pixels
+'
+' Returns:
+' Long
+'
+' Remarks:
+' GetTwipsFromPixel = TwipsPerPixelX * pixel
+'
'---------------------------------------------------------------------------------------
Public Function GetTwipsFromPixel(ByVal Pixel As Long) As Long
GetTwipsFromPixel = TwipsPerPixelX * Pixel
@@ -204,16 +199,18 @@ End Function
'---------------------------------------------------------------------------------------
' Function: GetPixelFromTwips
'---------------------------------------------------------------------------------------
-'/**
-'
-' Rechnet twips in Pixel um
-'
-' Anzahl twips
-' Long
-'
-' GetPixelFromTwips = twips / TwipsPerPixelX
-'
-'**/
+'
+' Converts twips to pixels
+'
+' Parameters:
+' Twips - Number of twips
+'
+' Returns:
+' Long
+'
+' Remarks:
+' GetPixelFromTwips = Twips / TwipsPerPixelX
+'
'---------------------------------------------------------------------------------------
Public Function GetPixelFromTwips(ByVal Twips As Long) As Long
GetPixelFromTwips = Twips / TwipsPerPixelX
diff --git a/source/codelib/api/winapi/WinApiShortcutMenu.cls b/source/codelib/api/winapi/WinApiShortcutMenu.cls
index c65ad8b..c3cd540 100644
--- a/source/codelib/api/winapi/WinApiShortcutMenu.cls
+++ b/source/codelib/api/winapi/WinApiShortcutMenu.cls
@@ -8,19 +8,23 @@ Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'---------------------------------------------------------------------------------------
-' Class Module: WinApiShortcutMenu
+' Class: api.winapi.WinApiShortcutMenu
'---------------------------------------------------------------------------------------
-'/**
-'
-' ShortcutMenu über Win-API
-'
-'
-'
-'\ingroup WinAPI
'
-' @todo Code aufräumen und Doxygen-Doku erstellen
+' ShortcutMenu via Win API
+'
+' Author:
+' Josef Poetzl
+'
+' @todo Clean up code and create doc
+'
+' Remarks:
+'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+' | Adapted variant from API example by Jörg Ostendorp of AEK10
+'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'
-'**/
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
'
' api/winapi/WinApiShortcutMenu.cls
@@ -33,10 +37,6 @@ Attribute VB_Exposed = False
Option Compare Text
Option Explicit
-'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-'Angepasste Variante aus API-Beispiel von Jörg Ostendorp der AEK10
-'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
Private Type POINTAPI
X As Long
Y As Long
@@ -51,7 +51,7 @@ End Type
#If VBA7 Then
-Private m_Helper As LongPtr 'Hilfsfenster-Handle
+Private m_Helper As LongPtr 'Auxiliary window handle
Private Type APIMSG
Hwnd As LongPtr
@@ -62,7 +62,7 @@ Private Type APIMSG
pt As POINTAPI
End Type
-'Hilfsfenster
+'Auxiliary window
Private Declare PtrSafe Function CreateWindowEx _
Lib "user32.dll" _
Alias "CreateWindowExA" ( _
@@ -79,7 +79,7 @@ Private Declare PtrSafe Function CreateWindowEx _
ByVal hInstance As LongPtr, _
ByRef lpParam As Any) As Long
-'Menü-Standardfunktionen
+'Standard menu functions
Private Declare PtrSafe Function CreatePopupMenu _
Lib "user32.dll" () As Long
@@ -108,7 +108,7 @@ Private Declare PtrSafe Function DestroyMenu _
ByVal hMenu As LongPtr _
) As Long
-'Message-Loop
+'Message Loop
Private Declare PtrSafe Function GetMessage _
Lib "user32.dll" _
Alias "GetMessageA" ( _
@@ -142,7 +142,7 @@ Private Declare PtrSafe Function SetMenuDefaultItem _
#Else
-Private m_Helper As Long 'Hilfsfenster-Handle
+Private m_Helper As Long 'Auxiliary window handle
Private Type APIMSG
Hwnd As Long
@@ -153,7 +153,7 @@ Private Type APIMSG
pt As POINTAPI
End Type
-'Hilfsfenster
+'Auxiliary window
Private Declare Function CreateWindowEx _
Lib "user32.dll" _
Alias "CreateWindowExA" ( _
@@ -170,7 +170,7 @@ Private Declare Function CreateWindowEx _
ByVal hInstance As Long, _
ByRef lpParam As Any) As Long
-'Menü-Standardfunktionen
+'Standard menu functions
Private Declare Function CreatePopupMenu _
Lib "user32.dll" () As Long
@@ -199,7 +199,7 @@ Private Declare Function DestroyMenu _
ByVal hMenu As Long _
) As Long
-'Message-Loop
+'Message Loop
Private Declare Function GetMessage _
Lib "user32.dll" _
Alias "GetMessageA" ( _
@@ -237,7 +237,7 @@ Private Declare Function SetMenuDefaultItem _
Private Const WM_COMMAND As Long = &H111
Private Const WM_MOUSELEAVE As Long = &H2A3
-'Menü- bzw. Item-Styles
+'Menu or item styles
Public Enum MenuItemStyle
MF_SEPARATOR = &H800&
@@ -251,14 +251,14 @@ Public Enum MenuItemStyle
MF_CHECKED = &H8&
End Enum
-'Menü-Ausrichtung
+'Menu alignment
Private Const TPM_BOTTOMALIGN As Long = &H20&
'Private Const TPM_TOPALIGN As Long = &H0&
-'Hilfsfenster
+'Auxiliary window
Private Const WS_CHILD As Long = &H40000000
-'---- Ergänzung
+'---- additions:
Private Type WinAPIMenuHandlerItem
ItemNumber As Long
@@ -376,17 +376,15 @@ End Property
'---------------------------------------------------------------------------------------
' Sub: AddMenuItem
'---------------------------------------------------------------------------------------
-'/**
-'
-' Menü-Eintrag erstellen
-'
-' Nummer des Menüeintrags
-' Text des Menüeintrags
-' Art des Menüeintrags
-' Nummer des zugeordneten Untermenüs
-'
-'
-'**/
+'
+' Create menu item
+'
+' Parameters:
+' MenuItemNumber - Number of the menu item
+' ItemText - Menu item text
+' ItemType - Menu item type
+' SubMenu - Number of the assigned submenu
+'
'---------------------------------------------------------------------------------------
Public Sub AddMenuItem(ByVal MenuItemNumber As Long, ByVal ItemText As String, _
Optional ByVal ItemType As MenuItemStyle = MF_STRING, _
@@ -409,16 +407,16 @@ End Sub
'---------------------------------------------------------------------------------------
' Function: OpenMenu
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Öffnet das Popup-Menü
-'
-' gewünschte X-Positon .. kann entfallen, wenn Control angegeben wurde
-' gewünschte Y-Positon .. kann entfallen, wenn Control angegeben wurde
-' Nummer des ausgewählten Menüeintrags
-'
-'
-'**/
+'
+' Parameters:
+' X - desired X position ... can be omitted if Control was specified
+' X - desired Y-position ... can be omitted if Control was specified
+'
+' Returns:
+' Long - Number of the selected menu item
+'
'---------------------------------------------------------------------------------------
Public Function OpenMenu(Optional ByVal X As Single = 0, Optional ByVal Y As Single = 0) As Long
@@ -442,13 +440,13 @@ Public Function OpenMenu(Optional ByVal X As Single = 0, Optional ByVal Y As Sin
Dim ParentObj As Object
Dim AccFormRect As RECT
- 'Sonst wird bei ENTER nix angezeigt:
+ 'Otherwise, nothing is displayed when ENTER is pressed:
DoEvents
- 'Leeres Menü erstellen
+ 'Create empty menu
MenuHwnd = CreatePopupMenu
- 'Einträge hinzufügen
+ 'Add entries
Dim i As Long
For i = 1 To m_ItemCnt
@@ -473,8 +471,8 @@ Public Function OpenMenu(Optional ByVal X As Single = 0, Optional ByVal Y As Sin
Next i
- 'Position ermitteln
- '- Hilfsfenster (~Sektionsfenster) absolut
+ 'Determine position
+ '- Auxiliary window (~section window) absolute
GetWindowRect m_Helper, RcHelper
If m_MenuControl Is Nothing Then
@@ -482,15 +480,15 @@ Public Function OpenMenu(Optional ByVal X As Single = 0, Optional ByVal Y As Sin
ButtonLeft = LayoutTools.GetPixelFromTwips(X) + AccFormRect.Left
ButtonTop = LayoutTools.GetPixelFromTwips(Y) + AccFormRect.Top
Else
- '- Buttom relativ zum Sektionsfenster
+ '- Buttom relative to the section window
ButtonLeft = LayoutTools.GetPixelFromTwips(m_MenuControl.Left) + LayoutTools.GetPixelFromTwips(X)
ButtonTop = LayoutTools.GetPixelFromTwips(m_MenuControl.Top) + LayoutTools.GetPixelFromTwips(Y)
End If
- '- Miteinander verrechnen
+ '- calc with each other
XPos = RcHelper.Left + ButtonLeft - 1
YPos = RcHelper.Top + ButtonTop
- 'Menü anzeigen
+ 'Show menu
If m_MenuControl Is Nothing Then
Set ParentObj = m_AccessForm
@@ -504,7 +502,7 @@ Public Function OpenMenu(Optional ByVal X As Single = 0, Optional ByVal Y As Sin
TrackPopupMenu MenuHwnd, TPM_BOTTOMALIGN, XPos, YPos, _
ByVal 0&, ParentObj.Hwnd, ByVal 0&
- 'Message-Loop (Obacht: für normale Formulare Application.hWndAccessApp, für POPUPS Me.hwnd)
+ 'Message-Loop (Attention: for normal forms Application.hWndAccessApp, for POPUPS Form.Hwnd)
If m_AccessForm.PopUp = True Then
Hwnd = m_AccessForm.Hwnd
@@ -513,13 +511,13 @@ Public Function OpenMenu(Optional ByVal X As Single = 0, Optional ByVal Y As Sin
End If
Dim RepeatGetMessage As Boolean
- Do 'Sicherheitsschliefe, falls es Probleme mit Windows-Message gibt. (WM_MOUSELEAVE)
+ Do ' Security sleep in case there are problems with windows message. (WM_MOUSELEAVE]
RepeatGetMessage = False
GetMessage Message, Hwnd, ByVal 0&, ByVal 0&
TranslateMessage Message
DispatchMessage Message
- 'Message auswerten
+ 'Evaluate message
If Message.Message = WM_COMMAND Then
OpenMenu = Message.wParam
ElseIf Message.Message = WM_MOUSELEAVE Then
@@ -529,7 +527,7 @@ Public Function OpenMenu(Optional ByVal X As Single = 0, Optional ByVal Y As Sin
End If
Loop While RepeatGetMessage
- 'Menü zerstören
+ 'Destroy menu
DestroyMenu MenuHwnd
End Function
diff --git a/source/codelib/api/winapi/WinApiWindowTools.cls b/source/codelib/api/winapi/WinApiWindowTools.cls
index bd9d00a..084dd7e 100644
--- a/source/codelib/api/winapi/WinApiWindowTools.cls
+++ b/source/codelib/api/winapi/WinApiWindowTools.cls
@@ -8,16 +8,22 @@ Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'---------------------------------------------------------------------------------------
-' Module: WinApiWindowTools
+' Class: api.winapi.WinApiWindowTools
'---------------------------------------------------------------------------------------
-'/**
-'
-' WinAPI-Funktionen: Window Handle & Co.
-'
-'
-'
-' \ingroup WinAPI
-'**/
+'
+' WinAPI functions: Window Handle & Co.
+'
+' Author:
+' Josef Poetzl
+'
+' Source info:
+'---------------------------------------------------------------------------------------
+'| The procedures GetMDI, GetHeaderSection, GetDetailSection, GetFooterSection and GetControl
+'| are taken from the AEK10 lecture by Jörg Ostendorp
+'---------------------------------------------------------------------------------------
+'
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
'
' api/winapi/WinApiWindowTools.cls
@@ -25,11 +31,6 @@ Attribute VB_Exposed = False
'
'---------------------------------------------------------------------------------------
'
-' Die Prozeduren (GetMDI, GetHeaderSection, GetDetailSection, GetFooterSection und GetControl
-' stammen aus dem AEK10-Vortrag von Jörg Ostendorp
-'
-'----------------------------------------------------------------------------------------
-'
Option Compare Text
Option Explicit
@@ -53,38 +54,36 @@ Private Declare PtrSafe Function FindWindowEx Lib "user32.dll" Alias "FindWindow
'---------------------------------------------------------------------------------------
' Function: GetMDI
'---------------------------------------------------------------------------------------
-'/**
-'
-' Ermittelt den Handle des MDI-Client-Fensters.
-'
-' Handle (Long)
-'
-'
-'**/
+'
+' Determines the handle of the MDI client window
+'
+' Returns:
+' Handle (LongPtr)
+'
'---------------------------------------------------------------------------------------
Public Function GetMDI() As LongPtr
Dim h As LongPtr
h = Application.hWndAccessApp
- 'Erstes (und einziges) "MDIClient"-Kindfenster des Applikationsfensters suchen
+ 'Find the first (and only) "MDIClient" child window of the application window.
GetMDI = FindWindowEx(h, 0&, "MDIClient", vbNullString)
End Function
'---------------------------------------------------------------------------------------
' Function: GetHeaderSection
'---------------------------------------------------------------------------------------
-'/**
-'
-' Ermittelt den Handle für den Kopfbereich eines Formulares
-'
-' Handle des Formulars (Form.Hwnd)
-' Long
-'
-'
-'**/
+'
+' Determines the handle for the header area of a form
+'
+' Parameters:
+' Hwnd - Handle of the form (Form.Hwnd)
+'
+' Returns:
+' LongPtr
+'
'---------------------------------------------------------------------------------------
Public Function GetHeaderSection(ByVal Hwnd As LongPtr) As LongPtr
Dim h As LongPtr
- 'Erstes "OFormsub"-Kindfenster des Formulares (fhwnd) ermitteln
+ 'Determine first "OFormsub" child window of the form (fhwnd)
h = FindWindowEx(Hwnd, 0&, "OformSub", vbNullString)
GetHeaderSection = h
End Function
@@ -92,20 +91,19 @@ End Function
'---------------------------------------------------------------------------------------
' Function: GetDetailSection
'---------------------------------------------------------------------------------------
-'/**
-'
-' Ermittelt den Handle für den Detailbereich eines Formulares
-'
-' Handle des Formulars (Form.Hwnd)
-' Long
-'
-'
-'**/
+'
+' Determines the handle for the detail area of a form
+'
+' Parameters:
+' Hwnd - Handle of the form (Form.Hwnd)
+'
+' Returns:
+' LongPtr
+'
'---------------------------------------------------------------------------------------
Public Function GetDetailSection(ByVal Hwnd As LongPtr) As LongPtr
Dim h As LongPtr
- 'Erstes "OFormsub"-Kindfenster des Formulares (fhwnd) ermitteln, beginnend
- 'nach dem Kopfbereich
+ 'Determine first "OFormsub" child window of the form (fhwnd), starting after the header area.
h = GetHeaderSection(Hwnd)
h = FindWindowEx(Hwnd, h, "OformSub", vbNullString)
GetDetailSection = h
@@ -114,20 +112,19 @@ End Function
'---------------------------------------------------------------------------------------
' Function: GetFooterSection
'---------------------------------------------------------------------------------------
-'/**
-'
-' Ermittelt den Handle für den Fußbereich eines Formulares
-'
-' Handle des Formulars (Form.Hwnd)
-' Long
-'
-'
-'**/
+'
+' Determines the handle for the footer of a form
+'
+' Parameters:
+' Hwnd - Handle of the form (Form.Hwnd)
+'
+' Returns:
+' LongPtr
+'
'---------------------------------------------------------------------------------------
Public Function GetFooterSection(ByVal Hwnd As Long) As LongPtr
Dim h As LongPtr
- 'Erstes "OFormsub"-Kindfenster des Formulares (fhwnd) ermitteln, beginnend
- 'nach dem Detailbereich
+ 'Determine first "OFormsub" child window of the form (fhwnd), starting after the detail area.
h = GetDetailSection(Hwnd)
h = FindWindowEx(Hwnd, h, "OformSub", vbNullString)
GetFooterSection = h
@@ -136,31 +133,22 @@ End Function
'---------------------------------------------------------------------------------------
' Function: GetControl
'---------------------------------------------------------------------------------------
-'/**
-'
-' Ermittelt den Handle eines beliebigen Controls
-'
-' Formular-Referenz
-' Handle des Bereichs, auf dem sich das Control befindet (Header, Detail, Footer)
-' Name der Fensterklasse des Controls
-' Name des Controls
-' Long
-'
-'
-'**/
-'---------------------------------------------------------------------------------------
-Public Function GetControl(ByRef FrmRef As Access.Form, ByVal Hwnd As LongPtr, _
+'
+' Determines the handle of any control
+'
+' Parameters:
+' FormRef - Form reference
+' Hwnd - Handle of the area on which the control is located (Header, Detail, Footer)
+' ClassName - Name of the window class of the control
+' ControlName - Name des Controls
+'
+' Returns:
+' LongPtr
+'
+'---------------------------------------------------------------------------------------
+Public Function GetControl(ByRef FormRef As Access.Form, ByVal Hwnd As LongPtr, _
ByVal ClassName As String, ByVal ControlName As String) As LongPtr
- 'Ermittelt den Handle eines beliebigen Controls
-
- 'Parameter:
- ' frm - Formular
- ' Handle des Bereichs, auf dem sich das Control befindet (Header, Detail, Footer)
- ' ControName - Name der Fensterklasse des Controls
- ' ControlName - Name des Controls
-
-
'Exitieren mehrere Controls der gleichen Klasse auf einem Formular, z.B. TabControls, besteht das Problem, daß
'deren Reihenfolge nicht definiert ist (anders also als bei den Sektionsfenstern)
'In diesem Fall kann man alle Kindfenster dieser Klasse in einer Schleife durchlaufen
@@ -191,7 +179,7 @@ On Error Resume Next
ClientToScreen h, pt
'Objekt bei den Koordinaten ermitteln
- Set obj = FrmRef.accHitTest(pt.X, pt.Y)
+ Set obj = FormRef.accHitTest(pt.X, pt.Y)
'Wenn Objektname = Tabname Ausstieg aus der Schleife
If obj.Name = ControlName Then
diff --git a/source/codelib/api/winapi/modWinAPI_Mouse.bas b/source/codelib/api/winapi/modWinAPI_Mouse.bas
index e19c3ce..6feae17 100644
--- a/source/codelib/api/winapi/modWinAPI_Mouse.bas
+++ b/source/codelib/api/winapi/modWinAPI_Mouse.bas
@@ -1,14 +1,12 @@
Attribute VB_Name = "modWinApi_Mouse"
'---------------------------------------------------------------------------------------
-' Module: modWinApi_Mouse
+' Package: api.winapi.modWinApi_Mouse
'---------------------------------------------------------------------------------------
-'/**
-'
-' Maus-Zeiger einstellen
-'
-'
-'
-'**/
+'
+' Set mouse cursor
+'
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
'
' api/winapi/modWinAPI_Mouse.bas
@@ -39,28 +37,28 @@ Public Enum IDC_MouseCursor
End Enum
#If VBA7 Then
- Private Declare PtrSafe Function LoadCursorBynum Lib "user32" Alias "LoadCursorA" (ByVal Instance As Long, ByVal LpCursorName As Long) As Long
- Private Declare PtrSafe Function SetCursor Lib "user32" (ByVal Cursor As Long) As Long
+ Private Declare PtrSafe Function LoadCursorBynum Lib "user32" Alias "LoadCursorA" (ByVal hInstance As LongPtr, ByVal LpCursorName As Long) As LongPtr
+ Private Declare PtrSafe Function SetCursor Lib "user32" (ByVal hCursor As LongPtr) As LongPtr
#Else
- Private Declare Function LoadCursorBynum Lib "user32" Alias "LoadCursorA" (ByVal Instance As Long, ByVal LpCursorName As Long) As Long
+ Private Declare Function LoadCursorBynum Lib "user32" Alias "LoadCursorA" (ByVal hInstance As Long, ByVal LpCursorName As Long) As Long
Private Declare Function SetCursor Lib "user32" (ByVal Cursor As Long) As Long
#End If
'---------------------------------------------------------------------------------------
' Sub: MouseCursor
'---------------------------------------------------------------------------------------
-'/**
-'
-' Mauszeiger einstellen
-'
-' Gewünschter Mauszeiger
-' Variant
-'
-'
-'**/
+'
+' Set mouse cursor
+'
+' Parameters:
+' CursorType - Desired mouse cursor
+'
'---------------------------------------------------------------------------------------
Public Sub MouseCursor(ByVal CursorType As IDC_MouseCursor)
- Dim Ret As Long
- Ret = LoadCursorBynum(0&, CursorType)
- Ret = SetCursor(Ret)
+
+ Dim CursorPtr As LongPtr
+
+ CursorPtr = LoadCursorBynum(0&, CursorType)
+ SetCursor CursorPtr
+
End Sub
diff --git a/source/codelib/base/ApplicationHandler.cls b/source/codelib/base/ApplicationHandler.cls
index c755a4e..85b4446 100644
--- a/source/codelib/base/ApplicationHandler.cls
+++ b/source/codelib/base/ApplicationHandler.cls
@@ -9,16 +9,16 @@ Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Attribute VB_Description = "Hauptsteuerung der Anwendung"
'---------------------------------------------------------------------------------------
-' Klassenmodul: ApplicationHandler (Josef Pötzl, 2009-12-11)
+' Class: base.ApplicationHandler
'---------------------------------------------------------------------------------------
-'/**
-'
-' Hauptsteuerung der Anwendung
-'
-'
-'
-'\ingroup base
-'**/
+'
+' Main control of the application
+'
+' Author:
+' Josef Poetzl
+'
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
'
' base/ApplicationHandler.cls
@@ -31,10 +31,10 @@ Option Compare Text
Option Explicit
Public Enum ApplicationHandlerResumeModes
- ' 0 ... keine Antwort
- AppResumeMode_Completed = 1 ' Anforderung wurde erfolgreich abgearbeitet
- AppResumeMode_Error = 2 ' Event wurde angenommen, aber es traten Fehler auf
- AppResumeMode_Cancel = 4 ' Event wurde angenommen, aber Weiterverabeitung soll gestoppt werden
+ [AppResumeMode_NoResponse] = 0 ' 0 ... no answer
+ AppResumeMode_Completed = 1 ' Request was successfully processed
+ AppResumeMode_Error = 2 ' Event was accepted, but errors occurred
+ AppResumeMode_Cancel = 4 ' Event was accepted, but further processing should be stopped
End Enum
Public Enum ApplicationHandlerLogType
@@ -44,17 +44,18 @@ Public Enum ApplicationHandlerLogType
End Enum
-' Integrierte Erweiterungen
+' Integrated extensions
Private Const EXTENSION_KEY_APPFILE As String = "AppFile"
-' Fehlerkennungen
+' Error codes
Private Const ERR_CLASS_ID As Long = 1000
+
Public Enum ApplicationHandlerErrors
AppErr_EventInterfaceMissing = vbObjectError + ERR_CLASS_ID + 1
End Enum
-' API-Funktionen
+' API definitions
Private Const GCL_HBRBACKGROUND As Long = -10
Private Const RDW_INVALIDATE As Long = &H1
Private Const RDW_ERASE As Long = &H4
@@ -96,7 +97,7 @@ Private Declare Function GetSysColor Lib "user32" (ByVal Index As Long) As Long
#End If
-' Hilfskonstanten
+' Auxiliary constants
Private Const LOG_FILE As String = "log.txt"
Private Const DBPROPNAME_APPTITLE As String = "AppTitle"
@@ -106,18 +107,17 @@ Private Const DBPROPNAME_STARTUPFORM As String = "StartUpForm"
Private Const DBPROPNAME_STARTUPMENUBAR As String = "StartUpMenuBar"
-'Hilfsvariablen
-Private m_AppDb As DAO.Database ' Ersatz für CurrentDb bzw. CodeDb, siehe Prop: AppDb
+'Auxiliary variables
+Private m_AppDb As DAO.Database ' Replacement for CurrentDb or CodeDb, see Prop: AppDb
-Private m_ApplicationName As String ' Zwischenspeicher für Anwendungsnamen (kurz)
-Private m_ApplicationFullName As String ' Zwischenspeicher für Anwendungsnamen (lang)
-
-Private m_APPLICATIONVERSION As String ' anzuzeigende Versionnummer
+Private m_ApplicationName As String ' Application name cache (short)
+Private m_ApplicationFullName As String ' Application name cache (long)
+Private m_APPLICATIONVERSION As String ' Version number to be displayed
Private m_TransferValue As Variant
-Private m_PublicPath As String ' Standardverzeichnis für Dateiexplorer
+Private m_PublicPath As String ' Default directory for file explorer
-Private m_ApplicationStartFormName As String ' Formular das in Start-Methode geöffnet wird
+Private m_ApplicationStartFormName As String ' Form that is opened in Start method
Private m_CustomMDIBackgroundColor As Long
@@ -165,16 +165,15 @@ Public Event BeforeStartApplication( _
Public Event AfterStartApplication( _
ByRef ResumeMode As ApplicationHandlerResumeModes, ByRef ResumeMessage As Variant)
-'Tracing-Schnittstelle
+'Tracing interface
Public Event NewAppLog( _
ByVal LogType As ApplicationHandlerLogType, ByVal Msg As String, ByVal Args As Variant, _
ByRef ResumeMode As ApplicationHandlerResumeModes, ByRef ResumeMessage As Variant)
-
Public WriteLogToFileIfNoEventResponse As Boolean
'---------------------------------------------------------------------------------------
-' Dispose-Ablauf
+' Disposable support
'---------------------------------------------------------------------------------------
Private m_Disposed As Boolean
Private Sub Class_Terminate()
@@ -210,18 +209,18 @@ On Error Resume Next
End Sub
'---------------------------------------------------------------------------------------
-' Function: Start (Josef Pötzl, 2009-12-15)
+' Function: Start
'---------------------------------------------------------------------------------------
-'/**
-'
-' Start der Anwendung
-'
-' Boolean
-'
-' Nicht Verwechseln mit Initialisierung von ApplicationHandler \n
-' Diese Prozedur löst die Startroutine für den Anwender aus.
-'
-'**/
+'
+' Application start
+'
+' Returns:
+' Boolean - true = success
+'
+' Remarks:
+' Do not confuse with initialization of ApplicationHandler.
+' This procedure triggers the startup routine for the user.
+'
'---------------------------------------------------------------------------------------
Public Function Start(Optional ByRef ResumeMessage As Variant) As Boolean
@@ -229,28 +228,28 @@ Public Function Start(Optional ByRef ResumeMessage As Variant) As Boolean
Dim EventResumeMode As ApplicationHandlerResumeModes
Dim EventResumeMessage As Variant
- 'Evente-Schnittstelle für Anwendungsstart
- ' ... ermöglicht z. B. das Durchführen eines Login-Vorgangs
+ 'Event interface for application start
+ ' ... enables e.g. the execution of a login process
RaiseEvent BeforeStartApplication(EventResumeMode, EventResumeMessage)
Select Case EventResumeMode
Case ApplicationHandlerResumeModes.AppResumeMode_Cancel
- 'Start abbrechen
+ 'Cancel start
ResumeMessage = EventResumeMessage
Start = False
Exit Function
Case ApplicationHandlerResumeModes.AppResumeMode_Completed
- 'Startprozedur wurde von Erweiterung übernommen
+ 'Start procedure was taken over from extension
Start = EventResumeMessage
Exit Function
Case ApplicationHandlerResumeModes.AppResumeMode_Error
- 'Mit Fehlermeldung abbrechen
+ 'Cancel with error message
Err.Raise vbObjectError, "BeforeStartApplication", EventResumeMessage
Exit Function
Case Else
- 'weitermachen
+ 'continue
End Select
- 'Update prüfen
+ 'Check update
If CheckVersionUpdate Then
If Me.UpdateApplication Then
Start = False
@@ -259,18 +258,18 @@ Public Function Start(Optional ByRef ResumeMessage As Variant) As Boolean
End If
End If
- 'Evente-Schnittstelle für Startformular
- '... ermöglich das Ändern des Startformulars durch ERweiterungen
- ' z. B. falls ein benutzerspezifisches Formulare geöffnet werden soll
+ 'Event interface for start form
+ '... allows changing the start form by means of extensions
+ ' e.g. if a user-specific form is to be opened
EventResumeMode = 0
EventResumeMessage = Empty
RaiseEvent BeforeOpenStartForm(EventResumeMode, EventResumeMessage)
Select Case EventResumeMode
Case ApplicationHandlerResumeModes.AppResumeMode_Cancel
- 'Startform nicht öffnen
+ 'Do not open startup form
CurrentStartFormName = vbNullString
Case ApplicationHandlerResumeModes.AppResumeMode_Completed
- 'Name des StartFormulars wurde übertragen
+ 'Name of the StartForm was transferred
CurrentStartFormName = Nz(EventResumeMessage, vbNullString)
Case Else
CurrentStartFormName = Me.ApplicationStartFormName
@@ -280,7 +279,7 @@ Public Function Start(Optional ByRef ResumeMessage As Variant) As Boolean
DoCmd.OpenForm CurrentStartFormName
End If
- 'Benachrichtigung über erfolgten Anwendungsstart
+ 'Notification about successful application start
EventResumeMode = 0
EventResumeMessage = Empty
RaiseEvent AfterStartApplication(EventResumeMode, EventResumeMessage)
@@ -293,18 +292,15 @@ End Function
'---------------------------------------------------------------------------------------
' Property: ApplicationName
'---------------------------------------------------------------------------------------
-'/**
-'
-' Name der aktuellen Anwendung
-'
-' String
-'
-' Reihenfolge der Namensermittlung:
-' 1. über gesetzten Wert
-' 2. aus Titel-Eigenschaft mit CurrentDb.Properties("AppTitle")
-' 3. aus Dateinamen mit CurrentDb.Name
-'
-'**/
+'
+' Name of the current application
+'
+' Remarks:
+' Sequence of name determination:
+' 1. over set value
+' 2. from title property with AppDb.Properties("AppTitle")
+' 3. from filenames with AppDb.Name
+'
'---------------------------------------------------------------------------------------
Public Property Get ApplicationName() As String
If Len(m_ApplicationName) = 0 Then 'Wert aus Titel-Eigenschaft, da Konstante nicht eingestellt wurde
@@ -318,16 +314,6 @@ Public Property Get ApplicationName() As String
ApplicationName = m_ApplicationName
End Property
-'---------------------------------------------------------------------------------------
-' Property: ApplicationName
-'---------------------------------------------------------------------------------------
-'/**
-'
-' Name der aktuellen Anwendung einstellen
-'
-' Anwendungsname
-'**/
-'---------------------------------------------------------------------------------------
Public Property Let ApplicationName(ByVal AppName As String)
m_ApplicationName = AppName
End Property
@@ -336,17 +322,14 @@ End Property
'---------------------------------------------------------------------------------------
' Property: ApplicationFullName
'---------------------------------------------------------------------------------------
-'/**
-'
-' Vollständiger Name der aktuellen Anwendung
-'
-' String
-'
-' Reihenfolge der Namensermittlung:
-' 1. über gesetzten Wert
-' 2. über ApplicationName
-'
-'**/
+'
+' Full name of the current application
+'
+' Remarks:
+' Sequence of name determination:
+' 1. over set value
+' 2. with ApplicationName property
+'
'---------------------------------------------------------------------------------------
Public Property Get ApplicationFullName() As String
If Len(m_ApplicationFullName) = 0 Then 'Kurzform verwenden
@@ -355,16 +338,6 @@ Public Property Get ApplicationFullName() As String
ApplicationFullName = m_ApplicationFullName
End Property
-'---------------------------------------------------------------------------------------
-' Property: ApplicationFullName
-'---------------------------------------------------------------------------------------
-'/**
-'
-' Name der aktuellen Anwendung einstellen
-'
-' Anwendungsname
-'**/
-'---------------------------------------------------------------------------------------
Public Property Let ApplicationFullName(ByVal AppName As String)
m_ApplicationFullName = AppName
End Property
@@ -372,17 +345,9 @@ End Property
'---------------------------------------------------------------------------------------
' Property: ApplicationVersion
'---------------------------------------------------------------------------------------
-'/**
-'
-' Vollständiger Name der aktuellen Anwendung
-'
-' String
-'
-' Reihenfolge der Namensermittlung:
-' 1. über gesetzten Wert
-' 2. über ApplicationName
-'
-'**/
+'
+' Application version
+'
'---------------------------------------------------------------------------------------
Public Property Get Version() As String
@@ -397,16 +362,6 @@ Public Property Get Version() As String
End Property
-'---------------------------------------------------------------------------------------
-' Property: ApplicationFullName
-'---------------------------------------------------------------------------------------
-'/**
-'
-' Name der aktuellen Anwendung einstellen
-'
-' Anwendungsname
-'**/
-'---------------------------------------------------------------------------------------
Public Property Let Version(ByVal AppVersion As String)
m_APPLICATIONVERSION = AppVersion
End Property
@@ -414,13 +369,9 @@ End Property
'---------------------------------------------------------------------------------------
' Property: ApplicationStartForm
'---------------------------------------------------------------------------------------
-'/**
-'
-' Formular, das in der Methode Start geöffnet wird
-'
-'
-'
-'**/
+'
+' Form opened in the method
+'
'---------------------------------------------------------------------------------------
Public Property Get ApplicationStartFormName() As String
If StrPtr(m_ApplicationStartFormName) = 0 Then ' ... aus Properties lesen?
@@ -429,33 +380,16 @@ Public Property Get ApplicationStartFormName() As String
ApplicationStartFormName = m_ApplicationStartFormName
End Property
-'---------------------------------------------------------------------------------------
-' Property: ApplicationStartForm
-'---------------------------------------------------------------------------------------
-'/**
-'
-' Formular, das in der Methode Start geöffnet wird
-'
-'
-'
-'**/
-'---------------------------------------------------------------------------------------
Public Property Let ApplicationStartFormName(ByVal FormName As String)
m_ApplicationStartFormName = FormName
End Property
-
'---------------------------------------------------------------------------------------
-' Property: AppDb (Josef Pötzl, 2009-12-13)
+' Property: AppDb
'---------------------------------------------------------------------------------------
-'/**
-'
-' Ersatz für CurrentDb bzw. CodeDb (Standard: CodeDb)
-'
-' zugewiesene DAO.Database-Instanz
-'
-'
-'**/
+'
+' Replacement for CurrentDb or CodeDb (default: CodeDb).
+'
'---------------------------------------------------------------------------------------
Public Property Get AppDb() As DAO.Database
If m_AppDb Is Nothing Then
@@ -616,7 +550,7 @@ Public Sub WriteLog(ByVal Msg As String, _
RaiseEvent NewAppLog(LogType, Msg, Args, ResumeMode, EventResumeMessage)
If ResumeMode = 0 And (WriteToFileIfNoEventResponse Or WriteLogToFileIfNoEventResponse Or LogType = AppLogType_Error) Then
- 'niemand hat reagiert bzw. einen Abbruch gemeldet => WriteApplicationLogEntry
+ 'no one has reacted or reported an abort => WriteApplicationLogEntry
Msg = Now() & ": " & Msg
If Len(LogType) > 0 Then
Msg = "(" & GetLogTypeString(LogType) & ") " & Msg
@@ -637,59 +571,31 @@ Private Function GetLogTypeString(Optional ByRef LogType As ApplicationHandlerLo
End Select
End Function
-
-Public Property Get MdiBackColor() As Long
-'/**
-' * @bug Ermitteln der Hintergrundfarbe des MDI-Bereichs Funktioniert nicht unter Access 2007
-'**/
- If m_CustomMDIBackgroundColor <> 0 Then
- MdiBackColor = m_CustomMDIBackgroundColor
- Else
- MdiBackColor = GetSysColor(SYSCOLOR_COLOR_APPWORKSPACE)
- End If
-End Property
-
-Friend Property Let MdiBackColor(ByVal Color As Long)
-
- Dim NewBrush As Long
- Dim hMDI As Long
-
- m_CustomMDIBackgroundColor = Color
- hMDI = FindWindowEx(Application.hWndAccessApp, 0&, "MDIClient", vbNullString)
-
- 'Brush erzeugen
- NewBrush = CreateSolidBrush(m_CustomMDIBackgroundColor)
- 'Brush zuweisen
- SetClassLong hMDI, GCL_HBRBACKGROUND, NewBrush
- 'Fenster neuzeichnen (gesamtes Fenster inkl. Background)
- RedrawWindow hMDI, ByVal 0&, ByVal 0&, RDW_INVALIDATE Or RDW_ERASE
-
-End Property
-
-
'---------------------------------------------------------------------------------------
' Function: CreateAppFile
'---------------------------------------------------------------------------------------
-'/**
-'
-' Datei aus AppFile-Tabelle extrahieren
-'
-' Kennung in Tabelle
-'
-' True = Datei wurde gespeichert
-'
-' Erfordert AppFile-Erweiterung (wird über Ereignis-Schnittstelle angesprochen)
-'
-'**/
+'
+' Extract file from AppFile table
+'
+' Parameters:
+' FileID - Identifier in table
+' FileName - File name to be created
+'
+' Returns:
+' Boolean - True: File was saved
+'
+' Remarks:
+' Requires extension (addressed via event interface)
+'
'---------------------------------------------------------------------------------------
Public Function CreateAppFile(ByVal FileID As String, ByVal FileName As String) As Boolean
- Dim EventResumeMode As ApplicationHandlerResumeModes ' Rückgabewert aus Event-Schnittstelle
- Dim EventResumeMessage As Variant ' Nachricht, für Abbruchgrund (wird derzeit noch nicht genutzt)
+ Dim EventResumeMode As ApplicationHandlerResumeModes ' Return value from event interface
+ Dim EventResumeMessage As Variant ' Message, for termination reason (currently not used)
'---------------------------------------------------
- ' Schnittstelle für andere Klassen .. damit wird es möglich,
- ' dass die Erstellung der Datei eine andere Klasse übernimmt
+ ' Interface for other classes ...
+ ' This makes it possible that the creation of the file takes over another class
'
EventResumeMode = 0
RaiseEvent AppFileBeforeCreateFile(FileID, FileName, EventResumeMode, EventResumeMessage)
@@ -705,26 +611,31 @@ End Function
'---------------------------------------------------------------------------------------
' Function: SaveAppFile
'---------------------------------------------------------------------------------------
-'/
-'
-' Datei in AppFile-Tabelle speichern
-'
-' Kennung in Tabelle (Feld "id")
-' Dateiname
-' Version abspeichern
-'
-' Erfordert ApplicationHandler_File (wird über Ereignis-Schnittstelle angesprochen)
-'
-'/
+'
+' Save file to AppFile table
+'
+' Parameters:
+' FileID - Identifier in table
+' FileName - File name to be created
+' SaveVersion - (optional) Read version from file (e. g. from dll file)
+' ExtFieldName - (optional) append additional data to data field: Field name
+' ExtFieldValue - (optional) append additional data to data field: Value
+'
+' Returns:
+' Boolean - True: File was saved in table
+'
+' Remarks:
+' Requires extension (addressed via event interface)
+'
'---------------------------------------------------------------------------------------
Friend Function SaveAppFile(ByVal FileID As String, ByVal FileName As String, Optional ByVal SaveVersion As Boolean = False, _
Optional ByVal ExtFieldName As String, Optional ByVal ExtFieldValue As Variant) As Boolean
- Dim EventResumeMode As ApplicationHandlerResumeModes ' Rückgabewert aus Event-Schnittstelle
- Dim EventResumeMessage As Variant ' Nachricht, für Abbruchgrund
+ Dim EventResumeMode As ApplicationHandlerResumeModes ' Return value from event interface
+ Dim EventResumeMessage As Variant ' Message, for termination reason
'---------------------------------------------------
- ' Event-Schnittstelle AppFileBeforeSaveFile
+ ' Event interface AppFileBeforeSaveFile
'
EventResumeMode = 0
RaiseEvent AppFileBeforeSaveFile(FileID, FileName, SaveVersion, EventResumeMode, EventResumeMessage, ExtFieldName, ExtFieldValue)
@@ -737,12 +648,53 @@ Friend Function SaveAppFile(ByVal FileID As String, ByVal FileName As String, Op
End Function
+Public Function NewerAppVersionExists() As Boolean
+
+ Dim ResumeMode As ApplicationHandlerResumeModes
+ Dim ResumeMessage As Boolean
+
+ RaiseEvent NewVersionExists(ResumeMode, ResumeMessage)
+
+ NewerAppVersionExists = ResumeMessage
+
+End Function
+
+Private Function CheckVersionUpdate() As Boolean
+' True = Update required
+
+ Dim EventResumeMode As ApplicationHandlerResumeModes
+ Dim EventResumeMessage As Variant
+ RaiseEvent CheckUpdate(EventResumeMode, EventResumeMessage)
+ If EventResumeMode = ApplicationHandlerResumeModes.AppResumeMode_Completed Then
+ CheckVersionUpdate = EventResumeMessage
+ Else
+ CheckVersionUpdate = False
+ End If
+
+End Function
+
+'---------------------------------------------------------------------------------------
+' Property: Extensions
+'---------------------------------------------------------------------------------------
+'
+' Try get Reference from extension over event interface
+'
+' Parameters:
+' ExtensionKey - Identifier of extension
+'
+' Returns:
+' Object - True: File was saved in table
+'
+' Remarks:
+' Requires extension (addressed via event interface)
+'
+'---------------------------------------------------------------------------------------
Public Property Get Extensions(ByVal ExtensionKey As String) As Object
-'Anm.: auf Auflistungs-Klasse verzichtet .. der Code ist zwar nicht so elegant, dafür ist eine kaum verwendete Klasse weniger
+'Note: collection class waived .. the code is not so elegant, but one less hardly used class
'/**
-' * @todo sollte man eine Schnittstelle statt Late binding verwenden?
+' * @todo Should you use an interface instead of late binding?
'**/
Dim ExtRef As Object
@@ -777,12 +729,11 @@ Public Function GetExtensionProperty(ByVal ExtensionKey As String, ByVal Propert
End Function
-
Public Function UpdateApplication() As Boolean
-' True = Anwendung schließen
+' True = Close application
-' => Ausgelager an Erweiterung: damit wird die Verwendugn flexibler
-' und jeder kann sich aussuchen nach welcher Update-Methode vorgegangen werden soll
+' => Outsourced to extension: this makes the usage more flexible
+' and everyone can choose which update method to follow
Dim EventResumeMode As ApplicationHandlerResumeModes
Dim EventResumeMessage As Variant
@@ -796,37 +747,19 @@ Public Function UpdateApplication() As Boolean
End Function
-Private Function CheckVersionUpdate() As Boolean
-' True = Update erforderlich
-
- Dim EventResumeMode As ApplicationHandlerResumeModes
- Dim EventResumeMessage As Variant
-
- RaiseEvent CheckUpdate(EventResumeMode, EventResumeMessage)
- If EventResumeMode = ApplicationHandlerResumeModes.AppResumeMode_Completed Then
- CheckVersionUpdate = EventResumeMessage
- Else
- CheckVersionUpdate = False
- End If
-
-End Function
-
'---------------------------------------------------------------------------------------
-' Sub: CallExtensionProcedure (Josef Pötzl, 2010-03-13)
+' Sub: CallExtensionProcedure
'---------------------------------------------------------------------------------------
-'/**
-'
-' Prozeduren aus Erweiterungen aufrufen
-'
-' Extension-Kennung
-' Name der zu startenden Prozedur
-' Rückgabekennung
-' Antwort
-' Array für Übergabe- und Rückgabeparameter
-'
-'
-'
-'**/
+'
+' Calling procedures from extensions
+'
+' Parameters:
+' Key - Extension identifier
+' ProcedureName - Name of the procedure to start
+' ResumeMode - Return identifier
+' ResumeMessage - Reply
+' Params - Array for pass and return parameters
+'
'---------------------------------------------------------------------------------------
Public Sub CallExtensionProcedure(ByVal Key As String, ByVal ProcedureName As String, _
ByRef ResumeMode As ApplicationHandlerResumeModes, ByRef ResumeMessage As Variant, _
@@ -835,14 +768,3 @@ Public Sub CallExtensionProcedure(ByVal Key As String, ByVal ProcedureName As St
RaiseEvent ExtensionProcedureCall(Key, ProcedureName, ResumeMode, ResumeMessage, Params)
End Sub
-
-Public Function NewerAppVersionExists() As Boolean
-
- Dim ResumeMode As ApplicationHandlerResumeModes
- Dim ResumeMessage As Boolean
-
- RaiseEvent NewVersionExists(ResumeMode, ResumeMessage)
-
- NewerAppVersionExists = ResumeMessage
-
-End Function
diff --git a/source/codelib/base/ApplicationHandler_AppFile.cls b/source/codelib/base/ApplicationHandler_AppFile.cls
index 3df4ce0..f4c3baf 100644
--- a/source/codelib/base/ApplicationHandler_AppFile.cls
+++ b/source/codelib/base/ApplicationHandler_AppFile.cls
@@ -9,20 +9,20 @@ Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Attribute VB_Description = "Erweiterung für ApplicationHandler-Klasse: Anwendungsspezifische Dateien verwalten"
'---------------------------------------------------------------------------------------
-' Klassenmodul: ApplicationHandler_File (Josef Pötzl, 2009-12-11)
+' Class: base.ApplicationHandler_File
'---------------------------------------------------------------------------------------
-'/**
-'
-' Erweiterung für ApplicationHandler-Klasse: Anwendungsspezifische Dateien verwalten
-'
-'
-' Aktivierung im _config_Application-Modul:\n
-' modApplication.AddApplicationHandlerExtension New ApplicationHandler_AppFile
-' oder mittels ExtensionCollection:\n
-' ExtensionsCollectionReferenz.Add New ApplicationHandler_AppFile
-'
-'\ingroup base
-'**/
+'
+' Extension for ApplicationHandler class: manage application-specific files
+'
+' Author:
+' Josef Poetzl
+'
+' Remarks:
+' Activation in the _config_Application module:
+' ExtensionsCollectionReferenz.Add New ApplicationHandler_AppFile
+'
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
'
' base/ApplicationHandler_AppFile.cls
@@ -46,7 +46,7 @@ Private Const TABLE_FIELD_FILE As String = "file"
'---------------------------------------------------------------------------------------
-' Standard-Initialisierung von Erweiterungen
+' Standard initialization of extensions
'---------------------------------------------------------------------------------------
Private WithEvents m_ApplicationHandler As ApplicationHandler
@@ -61,7 +61,7 @@ Public Property Get ExtensionKey() As String
End Property
'---------------------------------------------------------------------------------------
-' Standard-Ereignisbehandlung von Erweiterungen
+' Standard event handling of extensions
'---------------------------------------------------------------------------------------
' CheckExtension
@@ -89,14 +89,13 @@ End Sub
' AfterDispose
Private Sub m_ApplicationHandler_AfterDispose(ByRef ResumeMode As ApplicationHandlerResumeModes, ByRef ResumeMessage As Variant)
-'=> Referenz in m_ApplicationHandler auf Nothing setzen
+'=> Set reference in m_ApplicationHandler to Nothing
Set m_ApplicationHandler = Nothing
End Sub
-
'---------------------------------------------------------------------------------------
-' Ergänzungen für Ereiterung: ApplicationHandler_AppFile
+' Additions for extension: ApplicationHandler_AppFile
'---------------------------------------------------------------------------------------
'
@@ -122,18 +121,18 @@ Public Property Get AppFileTableName() As String
End Property
'---------------------------------------------------------------------------------------
-' Function: CreateAppFile (2009-07-30)
+' Function: CreateAppFile
'---------------------------------------------------------------------------------------
-'/**
-'
-' Datei aus usys_AppFiles extrahieren
-'
-' Datensatzkennung
-' zu erzeugender Dateiname
-' Boolean
-'
-'
-'**/
+'
+' Extract file from usys_AppFiles
+'
+' Parameters:
+' FileID - Record identifier
+' FileName - File name to be created
+'
+' Returns:
+' Boolean
+'
'---------------------------------------------------------------------------------------
Public Function CreateAppFile(ByVal FileID As String, ByVal FileName As String) As Boolean
@@ -176,16 +175,19 @@ End Sub
'---------------------------------------------------------------------------------------
' Function: SaveAppFile
'---------------------------------------------------------------------------------------
-'/
-'
+'
' Datei in usys_AppFiles speichern
-'
-' Kennung in Tabelle (Feld "id")
-' Dateiname
-' Version abspeichern
-'
-'
-'/
+'
+' Parameters:
+' FileID - Identifier in table
+' FileName - File name to be created
+' SaveVersion - (optional) Read version from file (e. g. from dll file)
+' ExtFieldName - (optional) append additional data to data field: Field name
+' ExtFieldValue - (optional) append additional data to data field: Value
+'
+' Returns:
+' Boolean - True: File was saved in table
+'
'---------------------------------------------------------------------------------------
Public Function SaveAppFile(ByVal FileID As String, ByVal FileName As String, _
Optional ByVal SaveVersion As Boolean = False, _
@@ -288,8 +290,9 @@ End Function
'---------------------------------------------------------------------------------------
-' Ereignisbehandlung von m_ApplicationHandler
+' Event handling of m_ApplicationHandler
'
+
' AppFileBeforeCreateFile
Private Sub m_ApplicationHandler_AppFileBeforeCreateFile(ByVal FileID As String, ByVal FileName As String, _
ByRef ResumeMode As ApplicationHandlerResumeModes, ByRef ResumeMessage As Variant)
@@ -316,7 +319,7 @@ Private Sub m_ApplicationHandler_AppFileBeforeSaveFile(ByVal FileID As String, B
Completed = SaveAppFile(FileID, FileName, SaveVersion, ExtFieldName, ExtFieldValue)
If Completed Then
ResumeMode = ApplicationHandlerResumeModes.AppResumeMode_Completed
- Else 'Fehler rückmelden
+ Else 'resume error
ResumeMode = ApplicationHandlerResumeModes.AppResumeMode_Error
End If
diff --git a/source/codelib/base/ApplicationHandler_ExtensionCollection.cls b/source/codelib/base/ApplicationHandler_ExtensionCollection.cls
index 2cac516..66233f5 100644
--- a/source/codelib/base/ApplicationHandler_ExtensionCollection.cls
+++ b/source/codelib/base/ApplicationHandler_ExtensionCollection.cls
@@ -8,27 +8,29 @@ Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'---------------------------------------------------------------------------------------
-' Klassenmodul: ApplicationHandler_ExtensionCollection
+' Class: base.ApplicationHandler_ExtensionCollection
'---------------------------------------------------------------------------------------
-'/**
-'
-' Einbindung der Erweiterungen für ApplicationHandler-Framework
-'
-'
-' Verwendung im _config_Application-Modul:\n
+'
+' Integration of the extensions for ApplicationHandler framework
+'
+' Author:
+' Josef Poetzl
+'
+' Remarks:
+' Use in the _config_Application module:
'
' Set m_Extensions = New ApplicationHandler_ExtensionCollection
' With m_Extensions
' Set .ApplicationHandler = oCurrentAppHandler
'
-' ' Erweiterungen laden (z. B. ApplicationHandler_DbConnection):
+' ' Load extensions (e.g. ApplicationHandler_DbConnection):
' .Add New ApplicationHandler_DbConnection
'
' End With
'
-'
-'\ingroup base
-'**/
+'
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
'
' base/ApplicationHandler_ExtensionCollection.cls
@@ -46,14 +48,11 @@ Private m_Extension As Collection
Private m_Disposed As Boolean
'---------------------------------------------------------------------------------------
-' Sub: Extensions
+' Property: Extensions
'---------------------------------------------------------------------------------------
-'/**
-'
-' Collection der Erweiterungen
-'
-'
-'**/
+'
+' Collection of extensions
+'
'---------------------------------------------------------------------------------------
Public Property Get Extensions() As Collection
If m_Extension Is Nothing Then
@@ -73,18 +72,17 @@ End Property
'---------------------------------------------------------------------------------------
' Sub: Add
'---------------------------------------------------------------------------------------
-'/**
-'
-' Erweiterung zu Collection hinzufügen
-'
-' Referenz auf Instanz der Erweiterung
-'
-' Referenz wird in Collection abgelegt, damit keine zusätzliche (manuelle)
-' Referenzspeicherung notwendig ist.
-'
-'**/
+'
+' Add extension to collection
+'
+' Parameters:
+' ExtensionRef - Reference to instance of extension
+'
+' Remarks:
+' Reference is stored in Collection so that no additional (manual) reference storage is necessary.
+'
'---------------------------------------------------------------------------------------
-Public Sub Add(ByRef ExtensionRef As Object)
+Public Sub Add(ByVal ExtensionRef As Object)
Set ExtensionRef.ApplicationHandlerRef = CurrentApplication
Extensions.Add ExtensionRef, ExtensionRef.ExtensionKey
End Sub
@@ -97,7 +95,7 @@ Public Sub Dispose()
On Error Resume Next
If Not (m_Extension Is Nothing) Then
- MaxCnt = m_Extension.Count * 2 'nur zur Sicherheit falls wider Erwarten m_Extension.Remove eine Endlosschleife bringen würde
+ MaxCnt = m_Extension.Count * 2 'just to be on the safe side in case m_Extension.Remove would bring an infinite loop against expectations
Do While m_Extension.Count > 0 Or CheckCnt > MaxCnt
m_Extension.Remove 1
CheckCnt = CheckCnt + 1
diff --git a/source/codelib/base/ApplicationHandler_Version.cls b/source/codelib/base/ApplicationHandler_Version.cls
index b479f47..6299eb5 100644
--- a/source/codelib/base/ApplicationHandler_Version.cls
+++ b/source/codelib/base/ApplicationHandler_Version.cls
@@ -8,20 +8,20 @@ Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'---------------------------------------------------------------------------------------
-' Klassenmodul: ApplicationHandler_Version (Josef Pötzl, 2015-11-08)
+' Class: base.ApplicationHandler_Version
'---------------------------------------------------------------------------------------
-'/**
-'
-' Erweiterung für ApplicationHandler-Klasse: Anwendungsversion prüfen
-'
-'
-' Aktivierung im _config_Application-Modul:\n
-' modApplication.AddApplicationHandlerExtension New ApplicationHandler_AppFile
-' oder mittels ExtensionCollection:\n
+'
+' Extension for ApplicationHandler class: Check application version
+'
+' Author:
+' Josef Poetzl
+'
+' Remarks:
+' Activation in the _config_Application module:
' ExtensionsCollectionReferenz.Add New ApplicationHandler_AppFile
-'
-'\ingroup base
-'**/
+'
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
'
' base/ApplicationHandler_Version.cls
@@ -44,7 +44,7 @@ Private Const EXTENSION_KEY As String = "AppVersion"
Private m_XmlVersionCheckFile As String
'---------------------------------------------------------------------------------------
-' Standard-Initialisierung von Erweiterungen
+' Standard initialization of extensions
'---------------------------------------------------------------------------------------
Private WithEvents m_ApplicationHandler As ApplicationHandler
@@ -59,7 +59,7 @@ Public Property Get ExtensionKey() As String
End Property
'---------------------------------------------------------------------------------------
-' Standard-Ereignisbehandlung von Erweiterungen
+' Standard event handling of extensions
'---------------------------------------------------------------------------------------
' CheckExtension
@@ -113,7 +113,7 @@ End Sub
' AfterDispose
Private Sub m_ApplicationHandler_AfterDispose(ByRef ResumeMode As ApplicationHandlerResumeModes, ByRef ResumeMessage As Variant)
-'=> Referenz in m_ApplicationHandler auf Nothing setzen
+'=> Set reference in m_ApplicationHandler to Nothing
Set m_ApplicationHandler = Nothing
End Sub
@@ -125,7 +125,7 @@ End Function
'---------------------------------------------------------------------------------------
-' Ergänzungen für Erweiterung: ApplicationHandler_AppVersion
+' Additions for extension: ApplicationHandler_AppVersion
'---------------------------------------------------------------------------------------
'
Private Sub GetExtensionPropertyLookup(ByVal PropertyName As String, _
@@ -136,7 +136,7 @@ Private Sub GetExtensionPropertyLookup(ByVal PropertyName As String, _
Select Case PropertyName
- Case Else 'Property wurde nicht erkannt
+ Case Else 'Property was not recognized
ResumeMode = AppResumeMode_Error
ResumeMessage = "Property '" & PropertyName & "' is not supported"
@@ -147,16 +147,16 @@ End Sub
'---------------------------------------------------------------------------------------
' Function: CheckVersion
'---------------------------------------------------------------------------------------
-'/**
-'
-' Version überprüfen
-'
-'
-'
-' AppVersionState
-'
-'
-'**/
+'
+' Check version
+'
+' Parameters:
+' NewVersion - ByRef return of new version
+' VersionRemarks - ByRef return of new version remarks
+'
+' Returns:
+' AppVersionState
+'
'---------------------------------------------------------------------------------------
Public Function CheckVersion(Optional ByRef NewVersion As Variant, Optional ByRef VersionRemarks As Variant) As AppVersionState
@@ -164,7 +164,7 @@ Public Function CheckVersion(Optional ByRef NewVersion As Variant, Optional ByRe
Dim DownloadVersionRemarks As String
DownloadVersion = GetVersionFromDownloadSource(XmlVersionCheckFile, DownloadVersionRemarks)
- CheckVersion = CompareVersions(CurrentApplication.Version, DownloadVersion)
+ CheckVersion = CompareVersions(m_ApplicationHandler.Version, DownloadVersion)
If CheckVersion = VerState_Newer Then
NewVersion = DownloadVersion
@@ -173,7 +173,6 @@ Public Function CheckVersion(Optional ByRef NewVersion As Variant, Optional ByRe
End Function
-
Public Property Get XmlVersionCheckFile() As String
XmlVersionCheckFile = m_XmlVersionCheckFile
End Property
diff --git a/source/codelib/base/_initApplication.bas b/source/codelib/base/_initApplication.bas
index c8e4ce3..42a82cd 100644
--- a/source/codelib/base/_initApplication.bas
+++ b/source/codelib/base/_initApplication.bas
@@ -15,7 +15,6 @@ Attribute VB_Name = "_initApplication"
' base/_initApplication.bas
' _codelib/license.bas
'
-'
'
'---------------------------------------------------------------------------------------
'
diff --git a/source/codelib/base/defGlobal.bas b/source/codelib/base/defGlobal.bas
deleted file mode 100644
index 255920f..0000000
--- a/source/codelib/base/defGlobal.bas
+++ /dev/null
@@ -1,92 +0,0 @@
-Attribute VB_Name = "defGlobal"
-Attribute VB_Description = "Allgemeine Konstanten und Eigenschaften"
-'---------------------------------------------------------------------------------------
-' Modul: defGlobal
-'---------------------------------------------------------------------------------------
-'/**
-'
-' Allgemeine Konstanten und Eigenschaften
-'
-'
-' \ingroup base
-'**/
-'---------------------------------------------------------------------------------------
-'
-' base/defGlobal.bas
-' _codelib/license.bas
-'
-'
-'---------------------------------------------------------------------------------------
-'
-Option Explicit
-Option Compare Text
-Option Private Module
-
-'---------------------------------------------------------------------------------------
-'
-' Konstanten
-'
-
-
-'---------------------------------------------------------------------------------------
-'
-' Hilfs-Variablen
-'
-
-
-'---------------------------------------------------------------------------------------
-'
-' Hilfs-Prozeduren
-'
-
-'
-' Private Hilfsvariablen für die Prozeduren
-'
-Private m_ApplicationName As String 'Zwischenspeicher für Anwendungsnamen, falls
- 'CurrentApplication.ApplicationName nicht läuft
-
-'---------------------------------------------------------------------------------------
-' Property: CurrentApplicationName
-'---------------------------------------------------------------------------------------
-'/**
-'
-' Name der aktuellen Anwendung
-'
-' String
-'
-' Verwendet CurrentApplication.ApplicationName
-'
-'**/
-'---------------------------------------------------------------------------------------
-Public Property Get CurrentApplicationName() As String
-' incl. emergency error handler if CurrentApplication is not instantiated
-
-On Error GoTo HandleErr
-
- CurrentApplicationName = CurrentApplication.ApplicationName
-
-ExitHere:
- Exit Property
-
-HandleErr:
- CurrentApplicationName = GetApplicationNameFromDb
- Resume ExitHere
-
-End Property
-
-Private Function GetApplicationNameFromDb() As String
-
- If Len(m_ApplicationName) = 0 Then
-On Error Resume Next
-'1. Value from title property
- m_ApplicationName = CodeDb.Properties("AppTitle").Value
- If Len(m_ApplicationName) = 0 Then
-'2. Value from file name
- m_ApplicationName = CodeDb.Name
- m_ApplicationName = Left$(m_ApplicationName, InStrRev(m_ApplicationName, ".") - 1)
- End If
- End If
-
- GetApplicationNameFromDb = m_ApplicationName
-
-End Function
diff --git a/source/codelib/base/modApplication.bas b/source/codelib/base/modApplication.bas
index ab577af..c6fd8f0 100644
--- a/source/codelib/base/modApplication.bas
+++ b/source/codelib/base/modApplication.bas
@@ -1,16 +1,13 @@
Attribute VB_Name = "modApplication"
Attribute VB_Description = "Standard-Prozeduren für die Arbeit mit ApplicationHandler"
'---------------------------------------------------------------------------------------
-' Module: modApplication
+' Package: base.modApplication
'---------------------------------------------------------------------------------------
-'/**
-'
-' Standard-Prozeduren für die Arbeit mit ApplicationHandler
-'
-'
-'
-' \ingroup base
-'**/
+'
+' Standard procedures for working with ApplicationHandler
+'
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
'
' base/modApplication.bas
@@ -24,23 +21,17 @@ Option Compare Text
Option Explicit
Option Private Module
-' Instanz der Hauptsteuerung
+' Instance of the main control
Private m_ApplicationHandler As ApplicationHandler
-
-' Erweiterungen zu ApplicationHandler (Ansteuerung erfolgt über Ereignisse von ApplicationHandler)
-Private m_Extension As Collection
+Private m_ApplicationName As String ' Cache for application names
+ ' if CurrentApplication.ApplicationName is not running
'---------------------------------------------------------------------------------------
' Property: CurrentApplication
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Property für ApplicationHandler-Instanz (diese Property im Code verwenden)
-'
-' aktuelle Instanz von ApplicationHandler
-'
-'
-'**/
+'
'---------------------------------------------------------------------------------------
Public Property Get CurrentApplication() As ApplicationHandler
If m_ApplicationHandler Is Nothing Then
@@ -50,43 +41,58 @@ Public Property Get CurrentApplication() As ApplicationHandler
End Property
'---------------------------------------------------------------------------------------
-' Sub: AddApplicationHandlerExtension
+' Property: CurrentApplicationName
'---------------------------------------------------------------------------------------
-'/**
-'
-' Erweiterung zu Collection hinzufügen
-'
-' Referenz auf Instanz der Erweiterung
-'
-' Referenz wird in Collection abgelegt, damit keine zusätzliche (manuelle)
-' Referenzspeicherung notwendig ist.
-'
-'**/
+'
+' Name der aktuellen Anwendung
+'
+' Remarks:
+' Verwendet CurrentApplication.ApplicationName
+'
'---------------------------------------------------------------------------------------
-Public Sub AddApplicationHandlerExtension(ByRef ObjRef As Object)
-' --- DEPRECATED ! ---
-' Durch Klasse ApplicationHandler_ExtensionCollection ersetzt.
-Stop
- If m_Extension Is Nothing Then
- Set m_Extension = New Collection
+Public Property Get CurrentApplicationName() As String
+' incl. emergency error handler if CurrentApplication is not instantiated
+
+On Error GoTo HandleErr
+
+ CurrentApplicationName = CurrentApplication.ApplicationName
+
+ExitHere:
+ Exit Property
+
+HandleErr:
+ CurrentApplicationName = GetApplicationNameFromDb
+ Resume ExitHere
+
+End Property
+
+Private Function GetApplicationNameFromDb() As String
+
+ If Len(m_ApplicationName) = 0 Then
+On Error Resume Next
+'1. Value from title property
+ m_ApplicationName = CodeDb.Properties("AppTitle").Value
+ If Len(m_ApplicationName) = 0 Then
+'2. Value from file name
+ m_ApplicationName = CodeDb.Name
+ m_ApplicationName = Left$(m_ApplicationName, InStrRev(m_ApplicationName, ".") - 1)
+ End If
End If
- Set ObjRef.ApplicationHandlerRef = CurrentApplication
- m_Extension.Add ObjRef, ObjRef.ExtensionKey
-End Sub
+ GetApplicationNameFromDb = m_ApplicationName
+
+End Function
'---------------------------------------------------------------------------------------
' Sub: TraceLog
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' TraceLog
-'
-'
-'
-'
-'
-'**/
+'
+' Parameters:
+' Msg
+' Args
+'
'---------------------------------------------------------------------------------------
Public Sub TraceLog(ByRef Msg As String, ParamArray Args() As Variant)
CurrentApplication.WriteLog Msg, ApplicationHandlerLogType.AppLogType_Tracing, Args
@@ -123,19 +129,6 @@ On Error Resume Next
If Not m_ApplicationHandler Is Nothing Then
m_ApplicationHandler.Dispose
End If
-
- If Not (m_Extension Is Nothing) Then
- ' --- DEPRECATED ! ---
- ' Durch Klasse ApplicationHandler_ExtensionCollection ersetzt.
- Stop
- WriteApplicationLogEntry "DisposeCurrentApplicationHandler: m_Extension in modApplication durch Klasse ApplicationHandler_ExtensionCollection ersetzt.", AppLogType_Error
- MaxCnt = m_Extension.Count * 2 'nur zur Sicherheit falls wider Erwarten m_Extension.Remove eine Endlosschleife bringen würde
- Do While m_Extension.Count > 0 Or CheckCnt > MaxCnt
- m_Extension.Remove 1
- CheckCnt = CheckCnt + 1
- Loop
- Set m_Extension = Nothing
- End If
Set m_ApplicationHandler = Nothing
diff --git a/source/codelib/base/modErrorHandler.bas b/source/codelib/base/modErrorHandler.bas
index e65815e..326f2d4 100644
--- a/source/codelib/base/modErrorHandler.bas
+++ b/source/codelib/base/modErrorHandler.bas
@@ -1,15 +1,16 @@
Attribute VB_Name = "modErrorHandler"
Attribute VB_Description = "Prozeduren für die Fehlerbehandlung"
'---------------------------------------------------------------------------------------
-' Modul: modErrorHandler
+' Package: base.modErrorHandler
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Error handling procedures
-'
-'
-'\ingroup base
-'**/
+'
+' Author:
+' Josef Poetzl
+'
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
'
' base/modErrorHandler.bas
@@ -24,21 +25,18 @@ Option Private Module
'---------------------------------------------------------------------------------------
' Enum: ACLibErrorHandlerMode
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' ErrorHandler Modes (error handling variants)
-'
-'
-' aclibErrRaise (0)Pass error to application
-' aclibErrMsgBox (1)Show error in MsgBox
-' aclibErrIgnore (2)ignore error, do not display any message
-' aclibErrFile (4)Write error information to file
-'
-'
+'
+' aclibErrRaise - (0) Pass error to application
+' aclibErrMsgBox - (1) Show error in MsgBox
+' aclibErrIgnore - (2) Ignore error, do not display any message
+' aclibErrFile - (4) Write error information to file
+'
+' Remarks:
' The values {0,1,2} exclude each other. The value 4 (aclibErrFile) can be added arbitrarily to {0,1,2}.
' Example: Init aclibErrRaise + aclibErrFile
-'
-'**/
+'
Public Enum ACLibErrorHandlerMode
[_aclibErr_default] = -1
aclibErrRaise = 0& 'Pass error to application
@@ -50,17 +48,16 @@ End Enum
'---------------------------------------------------------------------------------------
' Enum: ACLibErrorResumeMode
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Processing parameters in case of errors
-'
-'
-' aclibErrExit (0)Termination (function exit)
-' aclibErrResume (1)Resume, Problem fixed externally
-' aclibErrResumeNext (2)Resume next, continue working in the code at the next point
-'
-' Used for error events
-'**/
+'
+' aclibErrExit - (0) Termination (function exit)
+' aclibErrResume - (1) Resume, Problem fixed externally
+' aclibErrResumeNext - (2) Resume next, continue working in the code at the next point
+'
+' Remarks:
+' Used for error events
+'
Public Enum ACLibErrorResumeMode
aclibErrExit = 0 'Termination (function exit)
aclibErrResume = 1 'Resume, Problem fixed externally
@@ -70,10 +67,6 @@ End Enum
'---------------------------------------------------------------------------------------
' Enum: ACLibErrorNumbers
'---------------------------------------------------------------------------------------
-'/**
-'
-'
-'**/
Public Enum ACLibErrorNumbers
ERRNR_NOOBJECT = vbObjectError + 1001
ERRNR_NOCONFIG = vbObjectError + 1002
@@ -94,27 +87,15 @@ Private m_ErrorHandlerLogFile As String
'---------------------------------------------------------------------------------------
' Property: DefaultErrorHandlerMode
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Default behaviour of error handling
-'
-'**/
+'
'---------------------------------------------------------------------------------------
Public Property Get DefaultErrorHandlerMode() As ACLibErrorHandlerMode
On Error Resume Next
DefaultErrorHandlerMode = m_DefaultErrorHandlerMode
End Property
-'---------------------------------------------------------------------------------------
-' Property: DefaultErrorHandlerMode
-'---------------------------------------------------------------------------------------
-'/**
-'
-' Default behaviour of error handling
-'
-' ACLibErrorHandlerMode
-'**/
-'---------------------------------------------------------------------------------------
Public Property Let DefaultErrorHandlerMode(ByVal ErrMode As ACLibErrorHandlerMode)
m_DefaultErrorHandlerMode = ErrMode
End Property
@@ -122,26 +103,14 @@ End Property
'---------------------------------------------------------------------------------------
' Property: ErrorHandlerLogFile
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Log file for error message
-'
-'**/
+'
'---------------------------------------------------------------------------------------
Public Property Get ErrorHandlerLogFile() As String
ErrorHandlerLogFile = m_ErrorHandlerLogFile
End Property
-'---------------------------------------------------------------------------------------
-' Property: ErrorHandlerLogFile
-'---------------------------------------------------------------------------------------
-'/**
-'
-' Log file for error message
-'
-' Full file path
-'**/
-'---------------------------------------------------------------------------------------
Public Property Let ErrorHandlerLogFile(ByVal Path As String)
'/**
' * @todo: Checking for the existence of the file or at least the directory
@@ -152,21 +121,24 @@ End Property
'---------------------------------------------------------------------------------------
' Function: HandleError
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Standard procedure for error handling
-'
-'
-'
-'
-'
-' ACLibErrorResumeMode
-'
-'Beispiel:
-'==
-'Private Sub ExampleProc() \n
-'\n
-'On Error GoTo HandleErr \n
+'
+' Parameters:
+' ErrNumber">
+' ErrSource">
+' ErrDescription">
+' ErrHandlerMode">
+'
+' Returns:
+' ACLibErrorResumeMode
+'
+' Remarks:
+'Example:
+'
+'Private Sub ExampleProc()
+'
+'On Error GoTo HandleErr
'
'[...]
'
@@ -185,9 +157,8 @@ End Property
' End Select
'
'End Sub
-'==
-'
-'**/
+'
+'
'---------------------------------------------------------------------------------------
Public Function HandleError(ByVal ErrNumber As Long, ByVal ErrSource As String, _
Optional ByVal ErrDescription As String, _
diff --git a/source/codelib/data/DbConnectionHandler.cls b/source/codelib/data/DbConnectionHandler.cls
index 5faa1f5..9974002 100644
--- a/source/codelib/data/DbConnectionHandler.cls
+++ b/source/codelib/data/DbConnectionHandler.cls
@@ -8,16 +8,17 @@ Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'---------------------------------------------------------------------------------------
-' Klassenmodul: DbConnectionHandler
+' Class: data.DbConnectionHandler
'---------------------------------------------------------------------------------------
-'/**
-'
-' Datenbankverbindung per ADO oder DAO (inkl. ODBC)
-'
-'
-' Vereinheitlicht ADO- und DAO-Methoden
-'
-'**/
+' Database connection via ADODB or DAO (incl. ODBC)
+'
+' Standardises ADO and DAO methods
+'
+' Author:
+' Josef Poetzl
+'
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
'
' data/DbConnectionHandler.cls
@@ -41,65 +42,90 @@ Attribute m_AdodbHandler.VB_VarHelpID = -1
Private WithEvents m_OdbcHandler As OdbcHandler
Attribute m_OdbcHandler.VB_VarHelpID = -1
-'Error-Events für mögliche Fehlerbehandlung über die FE-Anwendung
-
-'/**
-'
-' Ereignis für fehlende CurrentDb-Referenz
-' (Weitergabe des DaoHandler- bzw. OdbcHandler-Ereignisses: ErrorMissingCurrentDb)
-'
-' Meldung über Ursache der Ereignisauslösung. (Wird noch nicht genutzt)
-' DAO.Database-Referenz, die für CurrentDb verwendet werden soll
-' über den ByRef-Parameter NewCurrentDbRef kann die passende DAO.Database-Referenz weitergegeben werden.
-'**/
+' Group: Events
+' Error events for possible error handling via the frontend application
+
+'---------------------------------------------------------------------------------------
+' Event: ErrorMissingCurrentDb
+'---------------------------------------------------------------------------------------
+' Event for missing CurrentDb reference
+' (Passing the or event: ErrorMissingCurrentDb)
+'
+' Parameters:
+' Msg - Message about the cause of the event triggering. (Not yet used)
+' NewCurrentDbRef - DAO.Database reference to be used for CurrentDb
+'
+' Remarks:
+' The required DAO.Database reference can be passed on via the ByRef parameter NewCurrentDbRef.
+'
+'---------------------------------------------------------------------------------------
Public Event ErrorMissingCurrentDb(ByVal Msg As String, ByRef NewCurrentDbRef As DAO.Database)
-'/**
-'
-' Ereignis für fehlende ADODB-Connection-Referenz
-' (Weitergabe des AdodbHandler-Ereignisses: ErrorMissingCurrentConnection)
-'
-' Meldung über Ursache der Ereignisauslösung. (Wird noch nicht genutzt)
-' ADODB.Connection-Referenz, die für CurrentConnection verwendet werden soll
-'
-' Über den ByRef-Parameter NewCurrentConnection kann die passende ADODB.Database-Referenz weitergegeben werden.
-' Eine Referenz-Weitergabe ist allerdings nicht zwingend erforderlich,
-' da z. B. in der ADODBHandler-Methode CurrentConnection
-' die Connection dann aus dem ConnectionString erstellt wird.
-'
-'**/
+'---------------------------------------------------------------------------------------
+' Event: ErrorMissingCurrentConnection
+'---------------------------------------------------------------------------------------
+'
+' Event for missing ADODB connection reference
+' (Passing the AdodbHandler event: )
+'
+' Parameters:
+' Msg - Message about the cause of the event triggering. (Not yet used)
+' NewCurrentConnection - ADODB.Connectionreference to be used for CurrentConnection
+'
+' Remarks:
+' The appropriate ADODB.Database reference can be passed on via the ByRef parameter NewCurrentConnection.
+' However, passing on a reference is not mandatory, since, it is stored in the AdodbHandler property .
+' The connection is then created from the
+'
+'---------------------------------------------------------------------------------------
Public Event ErrorMissingCurrentConnection(ByVal Msg As String, ByRef NewCurrentConnection As ADODB.Connection)
-'/**
-'
-' Ereignis für fehlenden OLEDB-Connectionstring
-' (Weitergabe des AdodbHandler-Ereignisses: ErrorEmptyOledbConnectionString)
-'
-' Meldung über Ursache der Ereignisauslösung. (Wird noch nicht genutzt)
-' OLEDB-Connectionstring
-' über den ByRef-Parameter NewConnectionString kann der passende OLEDB-Connectionstring weitergegeben werden.
-'**/
+'---------------------------------------------------------------------------------------
+' Event: ErrorEmptyOledbConnectionString
+'---------------------------------------------------------------------------------------
+'
+' Event for missing OLEDB connection string
+' (Passing the AdodbHandler event: )
+'
+' Parameters:
+' Msg - Message about the cause of the event triggering. (Not yet used)
+' NewConnectionString - OLEDB Connectionstring
+'
+' Remarks:
+' The appropriate OLEDB connection string can be passed on via the ByRef parameter NewConnectionString.
+'
+'---------------------------------------------------------------------------------------
Public Event ErrorEmptyOledbConnectionString(ByVal Msg As String, ByRef NewConnectionString As String)
-'/**
-'
-' Ereignis für fehlenden ODBC-Connectionstring
-' (Weitergabe des OdbcHandler-Ereignisses: ErrorEmptyConnectionString)
-'
-' Meldung über Ursache der Ereignisauslösung. (Wird noch nicht genutzt)
-' ODBC-Connectionstring
-' über den ByRef-Parameter NewConnectionString kann der passende ODBC-Connectionstring weitergegeben werden.
-'**/
+'---------------------------------------------------------------------------------------
+' Event: ErrorEmptyOdbcConnectionString
+'---------------------------------------------------------------------------------------
+'
+' Event for missing ODBC connection string
+' (Passing the OdbcHandler event: )
+'
+' Parameters:
+' Msg - Message about the cause of the event triggering. (Not yet used)
+' NewConnectionString - ODBC-Connectionstring
+'
+' Remarks:
+' The appropriate ODBC connection string can be passed on via the ByRef parameter NewConnectionString.
+'
+'---------------------------------------------------------------------------------------
Public Event ErrorEmptyOdbcConnectionString(ByVal Msg As String, ByRef NewConnectionString As String)
-'/**
-'
-' Ereignis-Meldung wenn Objektreferenzen entfernt wurden
-'
-'
-'**/
+'---------------------------------------------------------------------------------------
+' Event: Disposed
+'---------------------------------------------------------------------------------------
+'
+' Event message when object references have been removed
+'
+'---------------------------------------------------------------------------------------
Public Event Disposed()
+
+' Group: Dispose support
+
Private m_Disposed As Boolean
'
@@ -115,14 +141,11 @@ Private Sub Class_Terminate()
End Sub
'---------------------------------------------------------------------------------------
-' Sub: Dispose (06.04.2008)
+' Sub: Dispose
'---------------------------------------------------------------------------------------
-'/**
-'
-' Objektreferenzen entfernen
-'
-'
-'**/
+'
+' Remove object references
+'
'---------------------------------------------------------------------------------------
Public Sub Dispose()
@@ -160,24 +183,60 @@ End Sub
'#######################################################################################
+' Group: DAO data connection
+' DAO access methods
+' --------------------------------------------------------------------------------------
+
+'---------------------------------------------------------------------------------------
+' Property: DAO
+'---------------------------------------------------------------------------------------
+'
+' Instance of
+'
+' Returns:
+'
'
-' ADODB-Member
-' ------------
-'/** @name ADO
-' * ADO-Zugriff
-' */
-'//@{
+'---------------------------------------------------------------------------------------
+Public Property Get DAO() As DaoHandler
+ If m_DaoHandler Is Nothing Then
+ Set m_DaoHandler = New DaoHandler
+ End If
+ Set DAO = m_DaoHandler
+End Property
+
+'---------------------------------------------------------------------------------------
+' Property: CurrentDb
+'---------------------------------------------------------------------------------------
+'
+' CurrentDb =
+'
+' Returns:
+' DAO.Database
+'
+'---------------------------------------------------------------------------------------
+Public Property Get CurrentDb() As DAO.Database
+ Set CurrentDb = Me.DAO.CurrentDb
+End Property
+
+Public Property Set CurrentDb(ByRef NewCurrentDb As DAO.Database)
+ Set Me.DAO.CurrentDb = NewCurrentDb
+End Property
+
+
+'#######################################################################################
+' Group: ADODB data connection
+' ADODB access methods
+'---------------------------------------------------------------------------------------
'---------------------------------------------------------------------------------------
' Property: ADODB
'---------------------------------------------------------------------------------------
-'/**
-'
-' ADODB-Zugriffsmethoden
-'
-' AdodbHandler
-'
-'**/
+'
+' Instance of
+'
+' Returns:
+'
+'
'---------------------------------------------------------------------------------------
Public Property Get ADODB() As AdodbHandler
If m_AdodbHandler Is Nothing Then
@@ -189,29 +248,17 @@ End Property
'---------------------------------------------------------------------------------------
' Property: CurrentConnection
'---------------------------------------------------------------------------------------
-'/**
-'
-' ADODB-Connection zur akutellen DBSM-Verbindung = Me.ADODB.CurrentConnection
-'
-' ADODB.Connection
-'
-'*/
+'
+' ADODB connection to the current DBMS connection =
+'
+' Returns:
+' ADODB.Connection
+'
'---------------------------------------------------------------------------------------
Public Property Get CurrentConnection() As ADODB.Connection
Set CurrentConnection = Me.ADODB.CurrentConnection
End Property
-'---------------------------------------------------------------------------------------
-' Property: CurrentConnection
-'---------------------------------------------------------------------------------------
-'/**
-'
-' CurrentConnection = Me.ADODB.CurrentConnection
-'
-' Neue ADO-Connection
-'
-'**/
-'---------------------------------------------------------------------------------------
Public Property Set CurrentConnection(ByRef NewConnection As ADODB.Connection)
Set Me.ADODB.CurrentConnection = NewConnection
End Property
@@ -219,114 +266,36 @@ End Property
'---------------------------------------------------------------------------------------
' Property: OledbConnectionString
'---------------------------------------------------------------------------------------
-'/**
-'
-' OledbConnectionString = Me.ADODB.ConnectionString
-'
-' String
-'
-'**/
+'
+' OledbConnectionString =
+'
+' Returns:
+' String
+'
'---------------------------------------------------------------------------------------
-Public Property Get OledbConnectionString() As String
+Friend Property Get OledbConnectionString() As String
OledbConnectionString = Me.ADODB.ConnectionString
End Property
-'---------------------------------------------------------------------------------------
-' Property: OleDBConnectionString
-'---------------------------------------------------------------------------------------
-'/**
-'
-' OledbConnectionString = Me.ADODB.ConnectionString
-'
-'
-'**/
-'---------------------------------------------------------------------------------------
Public Property Let OledbConnectionString(ByVal NewConnectionString As String)
Me.ADODB.ConnectionString = NewConnectionString
End Property
-'//@}
'#######################################################################################
-'
-' DAO-Member
-' --------------
-'/** @name DAO
-' * DAO-Zugriff
-' */
-'//@{
-
-'---------------------------------------------------------------------------------------
-' Property: DAO
-'---------------------------------------------------------------------------------------
-'/**
-'
-' DAO-Zugriffsmethoden
-'
-' DaoHandler
-'
-'**/
-'---------------------------------------------------------------------------------------
-Public Property Get DAO() As DaoHandler
- If m_DaoHandler Is Nothing Then
- Set m_DaoHandler = New DaoHandler
- End If
- Set DAO = m_DaoHandler
-End Property
-
-'---------------------------------------------------------------------------------------
-' Property: CurrentDb
-'---------------------------------------------------------------------------------------
-'/**
-'
-' CurrentDb = Me.DAO.CurrentDb
-'
-' DAO.Database
-'
-'**/
+' Group: ODBC data connection
+' ODBC access methods
'---------------------------------------------------------------------------------------
-Public Property Get CurrentDb() As DAO.Database
- Set CurrentDb = Me.DAO.CurrentDb
-End Property
-
-'---------------------------------------------------------------------------------------
-' Property: CurrentDb
-'---------------------------------------------------------------------------------------
-'/**
-'
-' CurrentDb = Me.DAO.CurrentDb
-'
-' DAO.Database-Referenz die für CurrentDb verwendet werden soll
-' DAO.Database
-'
-'**/
-'---------------------------------------------------------------------------------------
-Public Property Set CurrentDb(ByRef NewCurrentDb As DAO.Database)
- Set Me.DAO.CurrentDb = NewCurrentDb
-End Property
-
-'//@}
-
-
-'#######################################################################################
-'
-' ODBC-Member
-' --------------
-'/** @name ODBC
-' * ODBC-Zugriff
-' */
-'//@{
'---------------------------------------------------------------------------------------
' Property: ODBC
'---------------------------------------------------------------------------------------
-'/**
-'
-' ODBC-Zugriffsmethoden
-'
-' OdbcHandler
-'
-'**/
+'
+' Instance of
+'
+' Returns:
+'
+'
'---------------------------------------------------------------------------------------
Public Property Get ODBC() As OdbcHandler
If m_OdbcHandler Is Nothing Then
@@ -338,28 +307,17 @@ End Property
'---------------------------------------------------------------------------------------
' Property: OdbcConnectionString
'---------------------------------------------------------------------------------------
-'/**
-'
-' ODBC-ConnectionString = Me.ODBC.ConnectionString
-'
-' String
-'
-'**/
+'
+' OdbcConnectionString =
+'
+' Returns:
+' String
+'
'---------------------------------------------------------------------------------------
-Public Property Get OdbcConnectionString() As String
+Friend Property Get OdbcConnectionString() As String
OdbcConnectionString = Me.ODBC.ConnectionString
End Property
-'---------------------------------------------------------------------------------------
-' Property: OdbcConnectionString
-'---------------------------------------------------------------------------------------
-'/**
-'
-' ODBC-ConnectionString = Me.ODBC.ConnectionString
-'
-'
-'**/
-'---------------------------------------------------------------------------------------
Public Property Let OdbcConnectionString(ByVal NewConnectionString As String)
Me.ODBC.ConnectionString = NewConnectionString
End Property
@@ -367,44 +325,30 @@ End Property
'---------------------------------------------------------------------------------------
' Property: CurrentDbBE
'---------------------------------------------------------------------------------------
-'/**
-'
-' CurrentDbBE = Me.ODBC.CurrentDbBE
-'
-' DAO.Database auf ODBC-Datenbank
-'
-'**/
+'
+' CurrentDbBE =
+'
+' Returns:
+' DAO.Database of ODBC database
+'
'---------------------------------------------------------------------------------------
Public Property Get CurrentDbBE() As DAO.Database
Set CurrentDbBE = Me.ODBC.CurrentDbBE
End Property
-'---------------------------------------------------------------------------------------
-' Property: CurrentDbBE
-'---------------------------------------------------------------------------------------
-'/**
-'
-' CurrentDbBE = Me.ODBC.CurrentDbBE
-'
-' DAO.Database-Referenz auf eine bereits geöffnete Datanbank
-' DAO.Database
-'
-'**/
-'---------------------------------------------------------------------------------------
Public Property Set CurrentDbBE(ByRef NewDb As DAO.Database)
If Not (NewDb Is Nothing) Then
Set Me.ODBC.CurrentDbBE = NewDb
End If
End Property
-'//@}
'#######################################################################################
'
-' Datenzugriff-Events
+' Data access events
' -------------------
-' ADODB-Handler-Events
+' AdodbHandler events
' --------------------
Private Sub m_AdodbHandler_ErrorMissingCurrentConnection(ByVal Msg As String, ByRef NewCurrentConnection As ADODB.Connection)
RaiseEvent ErrorMissingCurrentConnection(Msg, NewCurrentConnection)
@@ -414,15 +358,13 @@ Private Sub m_AdodbHandler_ErrorEmptyConnectionString(ByVal Msg As String, ByRef
RaiseEvent ErrorEmptyOledbConnectionString(Msg, NewConnectionString)
End Sub
-
-' DAO-Handler-Events
+' DaoHandler events
' ------------------
Private Sub m_DaoHandler_ErrorMissingCurrentDb(ByVal Msg As String, ByRef NewCurrentDbRef As DAO.Database)
RaiseEvent ErrorMissingCurrentDb(Msg, NewCurrentDbRef)
End Sub
-
-' ODBC-Handler-Events
+' OdbcHandler events
' ------------------
Private Sub m_OdbcHandler_ErrorEmptyConnectionString(ByVal Msg As String, ByRef NewConnectionString As String)
RaiseEvent ErrorEmptyOdbcConnectionString(Msg, NewConnectionString)
@@ -430,10 +372,10 @@ End Sub
Private Sub m_OdbcHandler_ErrorMissingCurrentDb(ByVal Msg As String, ByRef NewCurrentDbRef As DAO.Database)
- '1. Versuchen aus DAO-Klasse zu übergeben:
+ '1. Try to pass from DAO class:
Set NewCurrentDbRef = Me.DAO.CurrentDb
- '2. Event auslösen, falls auch Me.DAO.CurrentDb nichts liefert
+ '2. Trigger event if Me.DAO.CurrentDb also returns nothing
If NewCurrentDbRef Is Nothing Then
RaiseEvent ErrorMissingCurrentDb(Msg, NewCurrentDbRef)
If Not NewCurrentDbRef Is Nothing Then
diff --git a/source/codelib/data/DbConnectionInfo.cls b/source/codelib/data/DbConnectionInfo.cls
index dab6af8..f91fb7c 100644
--- a/source/codelib/data/DbConnectionInfo.cls
+++ b/source/codelib/data/DbConnectionInfo.cls
@@ -8,14 +8,18 @@ Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'---------------------------------------------------------------------------------------
-' Klassenmodul: DbConnectionInfo
+' Class: data.DbConnectionInfo
'---------------------------------------------------------------------------------------
-'/**
-'
-' Hilfsklasse zur Einstellung der Verbindungsparameter
-'
-'
-'**/
+' Auxiliary class for setting the connection parameters
+'
+' Author:
+' Josef Poetzl
+'
+' Remarks:
+' Uses table usys_DbmsConnection (create table with DBMS Connection Wizard)
+'
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
'
' data/DbConnectionInfo.cls
@@ -34,17 +38,29 @@ Private Enum DbConnectionInfoErrorNumbers
ERRNR_INACTIVE = vbObjectError + 3
End Enum
+Private Const ConnDataSelectSql As String = _
+ "SELECT CID, DBMS, dbmsConnectionMode, dbmsDatabase, dbmsUseTrustedConnection, dbmsUser, dbmsPwd, dbmsUseLoginForm, " & _
+ " dbmsServer, dbmsPort, dbmsOleDbProvider, dbmsOdbcDriver, dbmsOptionsOLEDB, dbmsOptionsODBC," & _
+ " dbmsDSN, dbmsConStrOLEDB, dbmsConStrODBC FROM usys_DbmsConnection"
+
+Private Const ActivatedConnDataSelectSql As String = _
+ ConnDataSelectSql & " WHERE ActiveConnection=-1"
+
+Private Const SelectConnectionIdentifierConnDataSelectSql As String = _
+ ConnDataSelectSql & " WHERE CID={ConnectionIdentifier}"
+
+
Private Const m_DefaultLoginFormName As String = "LoginForm"
Private m_LoginFormName As String
Private m_DbmsConfigFormName As String
-Private Const m_CheckConnectionTimeout As Long = 5 'Connectiontimeout für Verbindungsprüfung (Standard wäre 15 sec)
+Private Const m_CheckConnectionTimeoutSeconds As Long = 5 'Connection timeout [sec] for connection check (default would be 15 sec)
-'Verbindungskennung
-Private m_CID As String 'kann als Konstante verwendet werden, wenn nur eine Verbindungseinstellung genutzt werden soll
+'Connection identifier
+Private m_ConnectionIdentifier As String
-'DBMS-Bezeichnung
-Private m_DBMSNAME As String 'Variable, damit mit mehreren DBMS gearbeitet werden kann
+'DBMS Name
+Private m_DBMSNAME As String
Private Const m_DBMSNAME_MSJET As String = "MSJET"
Private Const m_DBMSNAME_MSSQL As String = "MSSQL"
@@ -52,37 +68,37 @@ Private Const m_DBMSNAME_MYSQL As String = "MySQL"
Private Const m_DBMSNAME_ORACLE As String = "ORACLE"
Private Const m_DBMSNAME_ODBC As String = "ODBC"
-'DBMS-Provider/Driver
+'DBMS Provider/Driver
Private m_DBODBCDRIVER As String
Private m_DBOLEDBPROVIDER As String
-'DB-Server (Anm.: inkl. Instanz beim SQL-Server):
+'Database Server (Note: incl. instance of SQL server & co.)
Private m_DBSERVER As String
-'Port (z. B. zur Unterscheidung vorhandener Server-Instanzen)
+'Port (e.g. to identify existing server instances)
Private m_PORT As String
-'DB-Name
-Private m_DBNAME As String 'muss vorhanden sein!
+'Database Name
+Private m_DBNAME As String 'required!
-'ConnectionMode (1 .. DNS less, 2 .. mit DSN, 128 .. benutzerdefinierter Connectionstring)
-Private m_CONNECTIONMODE As Long 'Enum DbmsConnectionModes
+'Connection modes (1 .. DNS less, 2 .. with DSN, 128 .. usedefined connection string)
+Private m_CONNECTIONMODE As DbmsConnectionModes
-'Benutzer-Kennung
+'User identifier
Private m_DBUSER As String
Private m_DBUSERPWD As String
Private m_TRUSTEDCONNECTION As Boolean
-'Weitere Optionen
+'Other Options
Private m_DBOPTIONS_ODBC As String
Private m_DBOPTIONS_OLEDB As String
-'ConnectionString
+'Connection string
Private m_OledbConnectionString As String
Private m_OdbcConnectionString As String
Private m_DatabaseFile As String 'für dateibasierte DBS
-'Login-Formular
+'Login form
Private m_UseLoginForm As Boolean
Private m_SAVEPWD As Boolean
@@ -96,59 +112,71 @@ Private m_LoginCancelled As Boolean
'DSN
Private m_DSN As String
+'Other auxiliary variables:
Private m_DbmsInfoReaded As Boolean
-'Events
-'/**
-'
-' Ereignis wenn sich die Verbindung ändert
-'
-' Fehlernummer
-' Prozedur(en) in der der Fehler auftrat
-' Fehlerbeschreibung
-' AcUtilErrorResumeMode-Wert (ermöglich Fehlersteuerung als Reaktion auf das Ereignis)
-' Kann nützlich sein, wenn in Abhängigkeit der Verbindung Anzeigen aktualisiert werden usw.
-'**/
-Public Event DbmsConnectionChanged(ByVal newCID As String)
-
-'Events
-'/**
-'
-' Ereignis wenn sich die Verbindung ändert
-'
-' Fehlernummer
-' Prozedur(en) in der der Fehler auftrat
-' Fehlerbeschreibung
-' AcUtilErrorResumeMode-Wert (ermöglich Fehlersteuerung als Reaktion auf das Ereignis)
-' Kann nützlich sein, wenn in Abhängigkeit der Verbindung Anzeigen aktualisiert werden usw.
-'**/
+'###################################################
+'
+' Group: Events
+'
+
+'---------------------------------------------------------------------------------------
+'Event: DbmsConnectionChanged
+'---------------------------------------------------------------------------------------
+'
+' Event when the connection changes
+'
+' Parameters:
+' NewConnectionIdentifier - new used connection identifier (from table data field CID)
+'
+' Remarks:
+' Can be useful if displays are updated depending on the connection, etc.
+'
+'---------------------------------------------------------------------------------------
+Public Event DbmsConnectionChanged(ByVal NewConnectionIdentifier As String)
+
+'---------------------------------------------------------------------------------------
+'Event: DbmsConnectionInfoCleared
+'---------------------------------------------------------------------------------------
+'
+' Event raised when the connection parameters have been reset
+'
+'---------------------------------------------------------------------------------------
Public Event DbmsConnectionInfoCleared()
-'/**
-'
-' Ereignis zur Weitergabe von Informationen
-'
-' Fehlernummer
-' Prozedur(en) in der der Fehler auftrat
-' Fehlerbeschreibung
-' AcUtilErrorResumeMode-Wert (ermöglich Fehlersteuerung als Reaktion auf das Ereignis)
-' Dient zur Weitergabe von Infos (ähnlich debug.print)
-'**/
+'---------------------------------------------------------------------------------------
+'Event: DbmsInfoMessage
+'---------------------------------------------------------------------------------------
+'
+' Information sharing event
+'
+' Parameters:
+' Source - Source of the message
+' Msg - Message
+' MsgStyle - VbMsgBoxStyle
+'
+' Remarks:
+' Used to pass on info (similar to debug.print)
+'
+'---------------------------------------------------------------------------------------
Public Event DbmsInfoMessage(ByVal Source As String, ByVal Msg As String, ByVal MsgStyle As VbMsgBoxStyle)
-''/**
-''
-'' Ereignis für Fehlermeldungen
-''
-'' Fehlernummer
-'' Prozedur(en) in der der Fehler auftrat
-'' Fehlerbeschreibung
-'' AcUtilErrorResumeMode-Wert (ermöglich Fehlersteuerung als Reaktion auf das Ereignis)
-'' Ermöglich die Behebung bzw. die Behandlung des Fehlers
-''**/
-'Public Event DbConnectionInfoError(ByVal ErrNumber As Long, ByVal Source As String, ByVal ErrDescription As String, ByRef Response As AcUtilErrorResumeMode)
-
+'---------------------------------------------------------------------------------------
+'Event: PasswordChanged
+'---------------------------------------------------------------------------------------
+'
+' Event raised when the password has been changed
+'
+'---------------------------------------------------------------------------------------
Public Event PasswordChanged()
+
+'---------------------------------------------------------------------------------------
+'Event: Disposed
+'---------------------------------------------------------------------------------------
+'
+' Event raised when disposed
+'
+'---------------------------------------------------------------------------------------
Public Event Disposed()
@@ -168,220 +196,156 @@ Private Declare PtrSafe Function WritePrivateProfileString Lib "kernel32" _
ByVal lpKeyName As Any, _
ByVal lpString As Any, _
ByVal lpFileName As String) As Long
+
+Private Sub Class_Terminate()
+On Error Resume Next
+ Dispose
+End Sub
-Public Property Get CID() As String
+Private Sub Dispose()
On Error Resume Next
- CID = m_CID
+#If CONFIG_USELOGINFORM = 1 Then
+ If Not (m_LoginForm Is Nothing) Then Set m_LoginForm = Nothing
+#End If
+ m_DbmsInfoReaded = False
+ RaiseEvent Disposed
+End Sub
+
+
+'###################################################
+'
+' Group: DBMS Connection Parameters
+'
+
+'---------------------------------------------------------------------------------------
+'Property: ConnectionIdentifier
+'---------------------------------------------------------------------------------------
+'
+' Connection identifier - value from data field CID
+'
+'---------------------------------------------------------------------------------------
+Public Property Get ConnectionIdentifier() As String
+On Error Resume Next
+ ConnectionIdentifier = m_ConnectionIdentifier
End Property
-Public Property Let CID(ByVal selectCID As String)
+Public Property Let ConnectionIdentifier(ByVal ConnectionIdentifierToUse As String)
On Error Resume Next
ClearConnectionInfo
- m_CID = selectCID
+ m_ConnectionIdentifier = ConnectionIdentifierToUse
- If Len(m_CID) > 0 Then
- ReadDBMSprop RaiseDbmsConnectionChangedEvent:=True
+ If Len(m_ConnectionIdentifier) > 0 Then
+ LoadConnectionData RaiseDbmsConnectionChangedEvent:=True
Else
RaiseEvent DbmsConnectionChanged(vbNullString)
End If
End Property
+Public Property Get CID() As String
+ Stop 'Deprecated: use ConnectionIdentifier
+ CID = ConnectionIdentifier
+End Property
+
+Public Property Let CID(ByVal SelectCID As String)
+ Stop 'Deprecated: use ConnectionIdentifier
+ ConnectionIdentifier = SelectCID
+End Property
+
+
+'---------------------------------------------------------------------------------------
+'Property: DbmsName
+'---------------------------------------------------------------------------------------
+'
+' Name of DBMS (MSJET, MSSQL, MySQL, ORACLE, ODBC)
+'
+'---------------------------------------------------------------------------------------
Public Property Get DbmsName() As String
On Error Resume Next
If StrPtr(m_DBMSNAME) = 0 Then
- ReadDBMSprop
+ LoadConnectionData
End If
DbmsName = m_DBMSNAME
End Property
+'---------------------------------------------------------------------------------------
+'Property: DbServer
+'---------------------------------------------------------------------------------------
+'
+' Name of Database Server
+'
+' Remarks:
+' Incl. instance of SQL Server & co.
+'
+'---------------------------------------------------------------------------------------
Public Property Get DbServer() As String
On Error Resume Next
DbServer = m_DBSERVER
End Property
+'---------------------------------------------------------------------------------------
+'Property: DbName
+'---------------------------------------------------------------------------------------
+'
+' Name of Database
+'
+'---------------------------------------------------------------------------------------
Public Property Get DbName() As String
On Error Resume Next
DbName = m_DBNAME
End Property
-Private Sub Class_Terminate()
-On Error Resume Next
- Dispose
-End Sub
-
-Private Sub Dispose()
-On Error Resume Next
-#If CONFIG_USELOGINFORM = 1 Then
- If Not (m_LoginForm Is Nothing) Then Set m_LoginForm = Nothing
-#End If
- m_DbmsInfoReaded = False
- RaiseEvent Disposed
-End Sub
-
-Private Sub ReadDBMSprop(Optional ByVal withoutLoginForm As Boolean = False, Optional ByVal RaiseDbmsConnectionChangedEvent As Boolean = False)
-
- Dim strSQL As String
- Dim rst As DAO.Recordset
- Dim bolCancel As Boolean
-
- Dim tempCID As String
-
- tempCID = m_CID
+'---------------------------------------------------------------------------------------
+' Property: DatabaseFile
+'---------------------------------------------------------------------------------------
+'
+' File name incl. path of a file-based backend
+'
+'---------------------------------------------------------------------------------------
+Public Property Get DatabaseFile() As String
- ClearConnectionInfo
-
- If Len(m_CID) = 0 Then 'jenen DS auswählen, der als "Aktiv" gekennzeichnet wurde
- strSQL = "SELECT CID, DBMS, dbmsConnectionMode, dbmsDatabase, dbmsUseTrustedConnection, dbmsUser, dbmsPwd, dbmsUseLoginForm, " & _
- " dbmsServer, dbmsPort, dbmsOleDbProvider, dbmsOdbcDriver, dbmsOptionsOLEDB, dbmsOptionsODBC," & _
- " dbmsDSN, dbmsConStrOLEDB, dbmsConStrODBC FROM usys_DbmsConnection WHERE ActiveConnection=-1"
- Else
- strSQL = "SELECT CID, DBMS, dbmsConnectionMode, dbmsDatabase, dbmsUseTrustedConnection, dbmsUser, dbmsPwd, dbmsUseLoginForm, " & _
- " dbmsServer, dbmsPort, dbmsOleDbProvider, dbmsOdbcDriver, dbmsOptionsOLEDB, dbmsOptionsODBC," & _
- " dbmsDSN, dbmsConStrOLEDB, dbmsConStrODBC FROM usys_DbmsConnection WHERE CID=" & SqlTools.TextToSqlText(m_CID)
- End If
-
- Set rst = CurrentDb.OpenRecordset(strSQL, dbOpenSnapshot)
- If rst.EOF Then
-
- rst.Close
-
- If Len(m_CID) = 0 Then 'es wurde noch keine Verbindung aktiviert
- bolCancel = True
- If MsgBox("Es wurde noch keine Verbindung aktiviert." & vbNewLine & _
- "Bitte überprüfen Sie die Verbindungsparameter und aktivieren Sie die gewünschte Verbindung.", _
- vbInformation + vbOKCancel) = vbOK Then
-
- If Len(DbmsConfigFormName) > 0 Then
- DoCmd.OpenForm DbmsConfigFormName, , , , , acDialog
- End If
-
- 'Abbruch, falls über Formular bereits initialisiert wurde
- If m_DbmsInfoReaded Then
- Exit Sub
- End If
-
- Set rst = CurrentDb.OpenRecordset(strSQL, dbOpenSnapshot)
- If Not rst.EOF Then
- m_CID = Nz(rst.Fields("CID"), vbNullString)
- bolCancel = (Len(m_CID) = 0)
- End If
- End If
-
- If bolCancel Then
- rst.Close
- Err.Raise DbConnectionInfoErrorNumbers.ERRNR_NODBMS, "DbConnectionInfo.readDBMSprop", "Es wurde keine Verbindung aktiviert."
- Exit Sub
- End If
- Else
- Err.Raise DbConnectionInfoErrorNumbers.ERRNR_NODBMS, "DbConnectionInfo.readDBMSprop", "Kein Eintrag für '" & m_CID & "' gefunden"
- Exit Sub
- End If
+ If Len(m_DatabaseFile) = 0 Then
+ SetConnectionStrings
End If
-
-
- 'Einstellungen auslesen
- With rst
-
- If Len(m_CID) = 0 Then
- m_CID = Nz(rst.Fields("CID"), vbNullString)
- If Len(m_CID) = 0 Then
- Err.Raise DbConnectionInfoErrorNumbers.ERRNR_NODBMS, "DbConnectionInfo.readDBMSprop", "Es wurde keine Verbindung übergeben."
- Exit Sub
- End If
- End If
-
- m_DBMSNAME = Nz(rst.Fields("DBMS"), vbNullString)
- m_CONNECTIONMODE = Nz(.Fields("dbmsConnectionMode"), 0) '1 = DNS less, 2 = DSN, 4 = benutzerdefiniert
-
- m_DBNAME = .Fields("dbmsDatabase") & vbNullString
-
- m_DBSERVER = .Fields("dbmsServer") & vbNullString
- m_PORT = .Fields("dbmsPort") & vbNullString
-
- m_TRUSTEDCONNECTION = Nz(.Fields("dbmsUseTrustedConnection"), False)
- m_UseLoginForm = Nz(.Fields("dbmsUseLoginForm"), False)
- m_DBUSER = .Fields("dbmsUser") & vbNullString
- m_DBUSERPWD = .Fields("dbmsPwd") & vbNullString
-
- 'Falls kein Name angegeben ist, Loginform aktivieren
- If Not (m_UseLoginForm Or m_TRUSTEDCONNECTION) And Len(m_DBUSER) = 0 Then
- m_UseLoginForm = (m_DBMSNAME <> "MSJET")
- End If
-
- m_DSN = .Fields("dbmsDSN") & vbNullString
-
- m_DBOLEDBPROVIDER = .Fields("dbmsOleDbProvider") & vbNullString
- m_DBOPTIONS_OLEDB = .Fields("dbmsOptionsOLEDB") & vbNullString
-
- m_DBODBCDRIVER = .Fields("dbmsOdbcDriver") & vbNullString
- m_DBOPTIONS_ODBC = .Fields("dbmsOptionsODBC") & vbNullString
-
- m_OledbConnectionString = .Fields("dbmsConStrOLEDB") & vbNullString
- m_OdbcConnectionString = .Fields("dbmsConStrODBC") & vbNullString
+ DatabaseFile = m_DatabaseFile
- .Close
- End With
- Set rst = Nothing
+End Property
- m_DbmsInfoReaded = True
- m_SAVEPWD = (Len(m_DBUSERPWD) > 0) And (m_UseLoginForm = False)
-
- If m_DBMSNAME = "MSJET" Then
- m_DatabaseFile = m_DBNAME
- End If
+'---------------------------------------------------------------------------------------
+' Property: UseLoginForm
+'---------------------------------------------------------------------------------------
+'
+' Setting from the connection parameters whether to use the login form when logging in.
+'
+'---------------------------------------------------------------------------------------
+Public Property Get UseLoginForm() As Boolean
- If Not withoutLoginForm Then
- If m_UseLoginForm Then 'ergibt Anmeldung, daher nicht für Vorabeinstellungen nutzen! (=>withoutLoginForm=true)
-#If CONFIG_USELOGINFORM = 1 Then
- Dim LoginUserName As String
- LoginUserName = GetUserNameFromConfigFile
- If Len(LoginUserName) = 0 Then
- LoginUserName = m_DBUSER
- End If
-
- 'm_LoginForm über Property LoginForm zugänglich machen und im LoginForm selbst setzen:
- DoCmd.OpenForm LoginFormName, acNormal, , , acFormEdit, acDialog, ObjPtr(Me) & "@" & m_CID & "@" & LoginUserName
-#Else
- Err.Raise vbObjectError, "DbConnectionInfo", "CONFIG_USELOGINFORM in Projekteigenschaften nicht gesetzt!"
-#End If
- End If
- End If
-
- If (tempCID <> m_CID) Or RaiseDbmsConnectionChangedEvent Then
- RaiseEvent DbmsConnectionChanged(m_CID)
+ If Not m_DbmsInfoReaded Then
+ SetConnectionStrings
End If
+ UseLoginForm = m_UseLoginForm
-End Sub
-
-Private Function GetUserNameFromConfigFile() As String
-
- Dim ReturnStr As String * 1280
- Dim RetVal As Long
-
-On Error Resume Next
-
- RetVal = GetPrivateProfileString("Login", "UserName", vbNullString & vbNullChar, ReturnStr, Len(ReturnStr), CurrentProject.Path & "\" & m_CID & ".ini")
- GetUserNameFromConfigFile = Trim(Left(ReturnStr, RetVal))
-
-End Function
+End Property
-Private Sub SaveUserNameToConfigFile(ByVal UserName As String)
-On Error Resume Next
- WritePrivateProfileString "Login", "UserName", UserName, CurrentProject.Path & "\" & m_CID & ".ini"
-End Sub
#If CONFIG_USELOGINFORM = 1 Then
+'---------------------------------------------------------------------------------------
+'Property: LoginForm
+'---------------------------------------------------------------------------------------
+'
+' Form reference to LoginForm
+'
+'---------------------------------------------------------------------------------------
Public Property Get LoginForm() As Form
On Error Resume Next
Set LoginForm = m_LoginForm
End Property
-Public Property Set LoginForm(ByRef ref As Form)
+Public Property Set LoginForm(ByVal NewRef As Form)
On Error Resume Next
- Set m_LoginForm = ref
+ Set m_LoginForm = NewRef
End Property
Private Sub m_LoginForm_Cancelled()
@@ -393,8 +357,6 @@ Private Sub m_LoginForm_Cancelled()
End Sub
-#End If
-
Private Sub m_LoginForm_Logon(ByVal LoginName As String, ByVal Password As String, Cancel As Boolean)
Dim ErrMsg As String
@@ -418,19 +380,19 @@ Private Sub m_LoginForm_Logon(ByVal LoginName As String, ByVal Password As Strin
SaveUserNameToConfigFile m_DBUSER
End If
-#If CONFIG_USELOGINFORM = 1 Then
Set m_LoginForm = Nothing
-#End If
End Sub
+#End If
+
Private Sub SetConnectionStrings(Optional ByVal bWithConnectionCheck As Boolean = True)
Dim myConnectionStrings As DbmsConnectionStrings
Dim ErrMsg As String
If Not m_DbmsInfoReaded Then
- ReadDBMSprop
+ LoadConnectionData
If m_LoginCancelled Or ((Len(m_DBSERVER) + Len(m_DBNAME)) = 0) Then
Exit Sub
End If
@@ -449,7 +411,7 @@ Private Sub SetConnectionStrings(Optional ByVal bWithConnectionCheck As Boolean
If Not m_DbmsInfoReaded Then
If Len(m_DBUSER) = 0 Then
- ReadDBMSprop
+ LoadConnectionData
End If
End If
@@ -472,115 +434,123 @@ Private Sub SetConnectionStrings(Optional ByVal bWithConnectionCheck As Boolean
End Sub
'---------------------------------------------------------------------------------------
-' Function: CheckConnection
+' Property: DbUser
'---------------------------------------------------------------------------------------
-'/**
-'
-' Verbindung zum Server bzw. Datenbank prüfen
-'
-' Fehlermeldung vom ADODB- bzw. ODBC-Verbindungsaufbau
-' Boolean: True = Ado- und ODBC-Verbindung konnten aufgebaut werden
-'
-' Als erster Test erfolgt der ADO-Verbindungsaufbau. Sobald dieser erfolgreich war, wird der ODBC-Verbindungsaufbau getestet.
-'
-'**/
+'
+' Name des Datenbankbenutzers
+'
+' Parameters:
+' WithoutServerCheck - True = Do not check whether connection data has already been read in.
+'
'---------------------------------------------------------------------------------------
-Public Function CheckConnection(Optional ByRef ErrMsg As String = vbNullString) As Boolean
-
- Dim checkOk As Boolean
+Public Property Get DbUser(Optional ByVal WithoutServerCheck As Boolean = False) As String
- checkOk = CheckAdoConnection(OledbConnectionString, ErrMsg)
- If checkOk Then ' ODBC testen (außer ADO-Verbindung schlug bereits fehl)
- If m_DBMSNAME <> "MSJET" Then
- checkOk = checkOk And CheckOdbcConnection(OdbcConnectionString, ErrMsg)
- End If
+ If Not WithoutServerCheck Then
+ If Not m_DbmsInfoReaded Then
+ SetConnectionStrings
+ End If
End If
- CheckConnection = checkOk
-
-End Function
+ If m_TRUSTEDCONNECTION Then
+ DbUser = GetDbUserName
+ Else
+ DbUser = m_DBUSER
+ End If
-Private Function CheckAdoConnection(ByVal sOleDbConnectionstring As String, ByRef Msg As String) As Boolean
+End Property
- Dim cnn As Object 'ADODB.Connection
- Dim i As Long
+'---------------------------------------------------------------------------------------
+' Property: DbUserPassword
+'---------------------------------------------------------------------------------------
+'
+' Password of the database user
+'
+' Remarks:
+' The password should normally never need to be requested and should only be used for sharing within the class structure.
+'
+'---------------------------------------------------------------------------------------
+Private Property Get DbUserPassword() As String
- If Len(sOleDbConnectionstring) = 0 Then
- CheckAdoConnection = False
- Exit Function
+ If Not m_DbmsInfoReaded Then
+ SetConnectionStrings
End If
-
- Set cnn = CreateObject("ADODB.Connection")
- With cnn
- .ConnectionString = sOleDbConnectionstring
- .ConnectionTimeout = m_CheckConnectionTimeout
-
-On Error Resume Next
- .Open
- If Err.Number <> 0 Then
- Msg = Msg & "Ursache (OLEDB):"
- For i = 0 To cnn.Errors.Count - 1
- Msg = Msg & vbNewLine & cnn.Errors(i).Description
- Next
- cnn.Errors.Clear
- Err.Clear
- CheckAdoConnection = False
- Exit Function
- End If
-
- If .State = adStateOpen Then
- .Close
- CheckAdoConnection = True
- Else
- CheckAdoConnection = False
- End If
- End With
- Set cnn = Nothing
+ DbUserPassword = m_DBUSERPWD
+
+End Property
-End Function
+Friend Property Let DbUserPassword(ByVal NewValue As String)
-Private Function CheckOdbcConnection(ByVal sOdbcConnectionstring As String, ByRef Msg As String) As Boolean
+ m_DBUSERPWD = NewValue
+
+End Property
- Dim db As DAO.Database
- Dim checkOk As Boolean
- Dim i As Long
+'---------------------------------------------------------------------------------------
+' Property: SavePassword
+'---------------------------------------------------------------------------------------
+'
+' Setting from the connection parameters whether password should be saved for linked tables
+'
+'---------------------------------------------------------------------------------------
+Public Property Get SavePassword() As Boolean
- If Len(sOdbcConnectionstring) = 0 Then
- CheckOdbcConnection = False
- Exit Function
+ If Not m_DbmsInfoReaded Then
+ SetConnectionStrings
End If
-
-On Error Resume Next
+ SavePassword = m_SAVEPWD
- Set db = DBEngine.OpenDatabase("", dbDriverComplete, True, sOdbcConnectionstring)
- If Err.Number <> 0 Then
- Msg = Msg & "Ursache (ODBC):"
- For i = 0 To DBEngine.Errors.Count - 1
- Msg = Msg & vbNewLine & DBEngine.Errors(i).Description
- Next
- Err.Clear
- checkOk = False
- Else
- checkOk = True
- db.Close
+End Property
+
+'###################################################
+'
+' Group: DBMS Connection
+'
+
+'---------------------------------------------------------------------------------------
+' Property: ConnectionStrings
+'---------------------------------------------------------------------------------------
+'
+' ODBC and OLEDB Connectionstring
+'
+' Returns:
+'
+'
+' Remarks:
+' This procedure must be extended if other DBMSs (such as Oracle) are to be used.
+'
+'---------------------------------------------------------------------------------------
+Friend Property Get ConnectionStrings() As DbmsConnectionStrings
+
+ If m_DbmsInfoReaded = False Then
+ LoadConnectionData
End If
- Set db = Nothing
-
- CheckOdbcConnection = checkOk
-End Function
+ Select Case m_DBMSNAME
+ Case m_DBMSNAME_MSSQL
+ ConnectionStrings = ConnectionStrings_MSSQL
+ Case m_DBMSNAME_MSJET
+ ConnectionStrings = ConnectionStrings_MSJET
+ Case m_DBMSNAME_MYSQL
+ ConnectionStrings = ConnectionStrings_MySQL
+ Case m_DBMSNAME_ORACLE
+ ConnectionStrings = ConnectionStrings_ORACLE
+ Case m_DBMSNAME_ODBC
+ ConnectionStrings = ConnectionStrings_ODBC
+ Case Else
+ Err.Raise DbConnectionInfoErrorNumbers.ERRNR_NODBMS, "ConnectionStrings", "Für '" & m_DBMSNAME & "' können keine Connectionstrings erzeugt werden. (Auswahl nicht möglich.)"
+ End Select
+
+End Property
+
'---------------------------------------------------------------------------------------
' Property: OledbConnectionString
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' OledbConnectionString
-'
-' String
-'
-'
-'**/
+'
+' Returns:
+' String
+'
'---------------------------------------------------------------------------------------
Friend Property Get OledbConnectionString() As String
@@ -594,23 +564,28 @@ End Property
'---------------------------------------------------------------------------------------
' Property: OdbcConnectionString
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' OdbcConnectionString
-'
-' False = Benutzerkennung ist im ODBC-Connectionstring nethalten, True = ohne Benutzerkennung
-' String
-' Das Einstellen des Parameters bWithoutUserInfo ist normalerweise nicht erforderlich, kann jedoch hilfreich sein, falls der ODBC-Connectionstring ohne Passwort angezeigt werden soll.
-'
-'**/
+'
+' Parameters:
+' WithoutUserInfo - False = user ID incl. password is contained in the ODBC connection string,
+' True = without user data
+'
+' Returns:
+' String
+'
+' Remarks:
+' Setting the parameter WithoutUserInfo is normally not necessary,
+' but can be helpful if the ODBC connection string is required without a password.
+'
'---------------------------------------------------------------------------------------
-Friend Property Get OdbcConnectionString(Optional ByVal bWithoutUserInfo As Boolean = False) As String
+Friend Property Get OdbcConnectionString(Optional ByVal WithoutUserInfo As Boolean = False) As String
If Len(m_OdbcConnectionString) = 0 Then
SetConnectionStrings
End If
- If bWithoutUserInfo Then
- OdbcConnectionString = Replace(m_OdbcConnectionString, getOdbcUserInfo(), "")
+ If WithoutUserInfo Then
+ OdbcConnectionString = Replace(m_OdbcConnectionString, GetOdbcUserInfo(), "")
Else
OdbcConnectionString = m_OdbcConnectionString
End If
@@ -618,130 +593,116 @@ Friend Property Get OdbcConnectionString(Optional ByVal bWithoutUserInfo As Bool
End Property
'---------------------------------------------------------------------------------------
-' Property: DatabaseFile
+' Function: CheckConnection
'---------------------------------------------------------------------------------------
-'/**
-'
-' Dateiname inkl. Pfad eines dateibasierten Backend
-'
-' String
-'
-'
-'**/
+'
+' Check connection to server and database
+'
+' Parameters:
+' ErrMsg - Error message from ADODB or ODBC connection
+'
+' Returns:
+' Boolean - True = Ado- and ODBC-connection could be established
+'
+' Remarks:
+' The first test is to establish the ADO connection.
+' As soon as this is successful, the ODBC connection is tested.
+'
'---------------------------------------------------------------------------------------
-Public Property Get DatabaseFile() As String
+Public Function CheckConnection(Optional ByRef ErrMsg As String = vbNullString) As Boolean
+
+ Dim checkOk As Boolean
- If Len(m_DatabaseFile) = 0 Then
- SetConnectionStrings
+ checkOk = CheckAdoConnection(OledbConnectionString, ErrMsg)
+ If checkOk Then ' test ODBC testen (if ADO connection don't failed)
+ If m_DBMSNAME <> "MSJET" Then
+ checkOk = checkOk And CheckOdbcConnection(OdbcConnectionString, ErrMsg)
+ End If
End If
- DatabaseFile = m_DatabaseFile
+
+ CheckConnection = checkOk
-End Property
+End Function
-'---------------------------------------------------------------------------------------
-' Property: DbUser
-'---------------------------------------------------------------------------------------
-'/**
-'
-' Name des Datenbankbenutzers
-'
-' True = Keine Prüfung durchführen, ob Verbidnungsdaten bereits eingelesen wurden
-' String
-'
-'
-'**/
-'---------------------------------------------------------------------------------------
-Public Property Get DbUser(Optional ByVal WithoutServerCheck As Boolean = False) As String
+Private Function CheckAdoConnection(ByVal sOleDbConnectionstring As String, ByRef Msg As String) As Boolean
- If Not WithoutServerCheck Then
- If Not m_DbmsInfoReaded Then
- SetConnectionStrings
- End If
+ Dim cnn As Object 'ADODB.Connection
+ Dim i As Long
+
+ If Len(sOleDbConnectionstring) = 0 Then
+ CheckAdoConnection = False
+ Exit Function
End If
- If m_TRUSTEDCONNECTION Then
- DbUser = getDbUserName
- Else
- DbUser = m_DBUSER
- End If
-
-End Property
+ Set cnn = CreateObject("ADODB.Connection")
+ With cnn
+ .ConnectionString = sOleDbConnectionstring
+ .ConnectionTimeout = m_CheckConnectionTimeoutSeconds
+
+On Error Resume Next
+ .Open
+ If Err.Number <> 0 Then
+ Msg = Msg & "Ursache (OLEDB):"
+ For i = 0 To cnn.Errors.Count - 1
+ Msg = Msg & vbNewLine & cnn.Errors(i).Description
+ Next
+ cnn.Errors.Clear
+ Err.Clear
+ CheckAdoConnection = False
+ Exit Function
+ End If
+
+ If .State = adStateOpen Then
+ .Close
+ CheckAdoConnection = True
+ Else
+ CheckAdoConnection = False
+ End If
+ End With
+ Set cnn = Nothing
-'---------------------------------------------------------------------------------------
-' Property: DbUserPassword
-'---------------------------------------------------------------------------------------
-'/**
-'
-' Passwort des Datenbankbenutzers, das bei Anmeldung eingegeben wurde
-'
-' String
-'
-' Das Passwort sollte normalerweise nie abgefragt werden müssen und nur zur Weitergabe innerhalb der Klassenstruktur benutzt werden.
-'
-'**/
-'---------------------------------------------------------------------------------------
-Private Property Get DbUserPassword() As String
+End Function
- If Not m_DbmsInfoReaded Then
- SetConnectionStrings
- End If
- DbUserPassword = m_DBUSERPWD
-
-End Property
+Private Function CheckOdbcConnection(ByVal sOdbcConnectionstring As String, ByRef Msg As String) As Boolean
-'---------------------------------------------------------------------------------------
-' Property: SavePassword
-'---------------------------------------------------------------------------------------
-'/**
-'
-' Einstellung aus den Verbindungsparametern, ob Passwort bei verknüpften Tabellen gespeichert werden soll
-'
-' Boolean
-'
-'
-'**/
-'---------------------------------------------------------------------------------------
-Public Property Get SavePassword() As Boolean
+ Dim db As DAO.Database
+ Dim checkOk As Boolean
+ Dim i As Long
- If Not m_DbmsInfoReaded Then
- SetConnectionStrings
+ If Len(sOdbcConnectionstring) = 0 Then
+ CheckOdbcConnection = False
+ Exit Function
End If
- SavePassword = m_SAVEPWD
-
-End Property
-
-'---------------------------------------------------------------------------------------
-' Property: UseLoginForm
-'---------------------------------------------------------------------------------------
-'/**
-'
-' Einstellung aus den Verbindungsparametern, ob beim Anmelden das Login-Formular verwendet werden soll
-'
-' Boolean
-'
-'
-'**/
-'---------------------------------------------------------------------------------------
-Public Property Get UseLoginForm() As Boolean
+
+On Error Resume Next
- If Not m_DbmsInfoReaded Then
- SetConnectionStrings
+ Set db = DBEngine.OpenDatabase("", dbDriverComplete, True, sOdbcConnectionstring)
+ If Err.Number <> 0 Then
+ Msg = Msg & "Ursache (ODBC):"
+ For i = 0 To DBEngine.Errors.Count - 1
+ Msg = Msg & vbNewLine & DBEngine.Errors(i).Description
+ Next
+ Err.Clear
+ checkOk = False
+ Else
+ checkOk = True
+ db.Close
End If
- UseLoginForm = m_UseLoginForm
+ Set db = Nothing
+
+ CheckOdbcConnection = checkOk
-End Property
+End Function
'---------------------------------------------------------------------------------------
' Sub: ClearConnectionInfo
'---------------------------------------------------------------------------------------
-'/**
-'
-' Eingestellte Verbindungsparameter löschen
-'
-'
-' Erfordert erneutes Einlesen aus Tabelle, wenn die Verbidnungsdaten angefordert werden.
-'
-'**/
+'
+' Delete set connection parameters
+'
+' Remarks:
+' Requires re-reading from table when connection data is requested.
+'
'---------------------------------------------------------------------------------------
Public Sub ClearConnectionInfo()
@@ -769,7 +730,7 @@ On Error Resume Next
m_LoginCancelled = False
m_DbmsInfoReaded = False
- If bolRaiseEvent Then 'Ereignis nur beim ersten Leeren auslösen
+ If bolRaiseEvent Then
RaiseEvent DbmsConnectionInfoCleared
End If
@@ -778,18 +739,18 @@ End Sub
'---------------------------------------------------------------------------------------
' Function: ChangeDbUserPassword
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Datenbankpasswort des Benutzers ändern
-'
-' Neues Passwort
-' Altes Passwort
-' Benutzername (Falls kein Benutzername übergeben wird, wird der aktuelle Benutzer eingesetzt)
-' ByRef-Parameter zur Rückgabe einer Fehlermeldung, falls das Passwort nicht geändert werden könnte
-' Boolean: True = Passwort wurde geändert
-'
-'
-'**/
+'
+' Parameters:
+' NewPassword - New passwort
+' OldPassword - old passwort
+' LoginName - Login name (If no login name is passed, the current login name is used).
+' Msg - ByRef parameter to return an error message if the password could not be changed
+'
+' Returns:
+' Boolean - True = Password has been changed
+'
'---------------------------------------------------------------------------------------
Public Function ChangeDbUserPassword( _
ByVal NewPassword As String, _
@@ -848,28 +809,25 @@ End Function
'#################################
'
-' DMBS-spezifische Prozeduren
+' Group: DMBS specific
'
'---------------------------------------------------------------------------------------
' Property: PermanentBackendRstSqlText
'---------------------------------------------------------------------------------------
-'/**
-'
-' Select-Anweisung für ODBC-Recordsetverbindung zum Aufrechterhalten der Verbindung
-'
-' String
-'
-' Diese Prozedur muss erweitert werden, wenn weitere DBMS (wie Oracle) eingesetzt werden sollen.
-'
-'**/
+'
+' Select statement for ODBC recordset connection to maintain connection
+'
+' Remarks:
+' This procedure must be extended if other DBMSs (such as Oracle) are to be used.
+'
'---------------------------------------------------------------------------------------
Public Property Get PermanentBackendRstSqlText() As String
On Error Resume Next
PermanentBackendRstSqlText = "select 1"
End Property
-Private Function getDbUserName() As String
+Private Function GetDbUserName() As String
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
@@ -892,54 +850,18 @@ Private Function getDbUserName() As String
Set rst = cnn.Execute(strSQL)
- getDbUserName = Nz(rst.Fields(0), "N/A")
+ GetDbUserName = Nz(rst.Fields(0), "N/A")
rst.Close
cnn.Close
End Function
-'---------------------------------------------------------------------------------------
-' Property: ConnectionStrings
-'---------------------------------------------------------------------------------------
-'/**
-'
-' ODBC- und OLEDB-Connectionstring
-'
-' DbmsConnectionStrings
-'
-' Diese Prozedur muss erweitert werden, wenn weitere DBMS (wie Oracle) eingesetzt werden sollen.
-'
-'**/
-'---------------------------------------------------------------------------------------
-Friend Property Get ConnectionStrings() As DbmsConnectionStrings
-
- If m_DbmsInfoReaded = False Then
- ReadDBMSprop
- End If
-
- Select Case m_DBMSNAME
- Case m_DBMSNAME_MSSQL
- ConnectionStrings = ConnectionStrings_MSSQL
- Case m_DBMSNAME_MSJET
- ConnectionStrings = ConnectionStrings_MSJET
- Case m_DBMSNAME_MYSQL
- ConnectionStrings = ConnectionStrings_MySQL
- Case m_DBMSNAME_ORACLE
- ConnectionStrings = ConnectionStrings_ORACLE
- Case m_DBMSNAME_ODBC
- ConnectionStrings = ConnectionStrings_ODBC
- Case Else
- Err.Raise DbConnectionInfoErrorNumbers.ERRNR_NODBMS, "ConnectionStrings", "Für '" & m_DBMSNAME & "' können keine Connectionstrings erzeugt werden. (Auswahl nicht möglich.)"
- End Select
-
-End Property
-
-Private Function getOdbcUserInfo(Optional ByVal sUID As String = vbNullString, _
+Private Function GetOdbcUserInfo(Optional ByVal sUID As String = vbNullString, _
Optional ByVal sPWD As String = vbNullString) As String
If Len(sUID) = 0 Then
If m_DbmsInfoReaded = False Then
- ReadDBMSprop
+ LoadConnectionData
End If
sUID = m_DBUSER
sPWD = m_DBUSERPWD
@@ -947,11 +869,11 @@ Private Function getOdbcUserInfo(Optional ByVal sUID As String = vbNullString, _
Select Case m_DBMSNAME
Case m_DBMSNAME_MSSQL
- getOdbcUserInfo = getOdbcUserInfo_MSSQL(sUID, sPWD)
+ GetOdbcUserInfo = getOdbcUserInfo_MSSQL(sUID, sPWD)
Case m_DBMSNAME_MYSQL
- getOdbcUserInfo = getOdbcUserInfo_MySQL(sUID, sPWD)
+ GetOdbcUserInfo = getOdbcUserInfo_MySQL(sUID, sPWD)
Case m_DBMSNAME_ORACLE
- getOdbcUserInfo = getOdbcUserInfo_ORACLE(sUID, sPWD)
+ GetOdbcUserInfo = getOdbcUserInfo_ORACLE(sUID, sPWD)
Case Else
On Error GoTo 0
Err.Raise DbConnectionInfoErrorNumbers.ERRNR_NODBMS, "DbConnectionInfo.getOdbcUserInfo", "Für '" & m_DBMSNAME & "' kann keine OdbcUserInfo erzeugt werden. (Auswahl nicht möglich.)"
@@ -1059,7 +981,7 @@ Private Function ConnectionStrings_MySQL() As DbmsConnectionStrings
If m_TRUSTEDCONNECTION Then 'Wie würde das bei MySQL funktionieren?
m_TRUSTEDCONNECTION = False
- If setLoginData Then
+ If SetLoginData Then
strODBC = getOdbcUserInfo_MySQL(m_DBUSER, m_DBUSERPWD) & ";"
Else
On Error GoTo 0
@@ -1195,15 +1117,12 @@ End Function
'---------------------------------------------------------------------------------------
' Property: TableListSqlText
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' SQL-Anweisung im SQL-Dialtekt des DBMS zur Auflistung der im DBS enthaltenen Tabellen
-'
-' String
-'
-' Diese Prozedur muss erweitert werden, wenn weitere DBMS (wie Oracle) eingesetzt werden sollen.
-'
-'**/
+'
+' Remarks:
+' This procedure must be extended if further DBMS are to be used.
+'
'---------------------------------------------------------------------------------------
Public Property Get TableListSqlText() As String
@@ -1226,7 +1145,7 @@ Public Property Get TableListSqlText() As String
End Property
-Private Function setLoginData() As Boolean
+Private Function SetLoginData() As Boolean
Dim cnn As ADODB.Connection
Dim cmd As ADODB.Command
@@ -1249,11 +1168,11 @@ Private Function setLoginData() As Boolean
If rst.EOF Then
m_DBUSER = strWindowUser
m_DBUSERPWD = vbNullString
- setLoginData = False
+ SetLoginData = False
Else
m_DBUSER = rst.Fields(0)
m_DBUSERPWD = rst.Fields(1)
- setLoginData = True
+ SetLoginData = True
End If
rst.Close
@@ -1265,32 +1184,44 @@ End Function
'---------------------------------------------------------------------------------------
' Function: ParseTableName
'---------------------------------------------------------------------------------------
-'/**
-'
-' Hilfsprozedur zum Anpassen des Tabellennamens
-'
-' Tabellename
-' String
-'
-' Bei manchen DBMS muss Groß- o. Kleinschreibung beachtet bzw. der Name mit Sonderzeichen eingeklammert werden.
-'
-'**/
-'---------------------------------------------------------------------------------------
-Public Function ParseTableName(ByVal sTabName As String) As String
+'
+' Auxiliary procedure for adjusting the table name
+'
+' Parameters:
+' TableName - Table name to parse
+'
+' Returns:
+' Table name for the specific DBMS
+'
+' Remarks:
+' With some DBMS, the name must be case-sensitive or bracketed with special characters.
+'
+'---------------------------------------------------------------------------------------
+Public Function ParseTableName(ByVal TableName As String) As String
Select Case m_DBMSNAME
Case m_DBMSNAME_MSJET
- ParseTableName = "[" & sTabName & "]"
- Case m_DBMSNAME_MSSQL 'keine Änderung erforderlich - zur Sicherheint in Anführugnszeichen einklammern, damit auch Tabellennamen mit Leerzeichen verwendet werden können
- ParseTableName = """" & sTabName & """"
- Case m_DBMSNAME_MYSQL 'zur Sicherheit in "`" einklammern.
- ParseTableName = "`" & sTabName & "`"
+ ParseTableName = "[" & TableName & "]"
+ Case m_DBMSNAME_MSSQL ' No change required - for safety, enclose in inverted commas so that table names with spaces can also be used.
+ ParseTableName = """" & TableName & """"
+ Case m_DBMSNAME_MYSQL 'bracket in "`" for safety.
+ ParseTableName = "`" & TableName & "`"
Case m_DBMSNAME_ORACLE
- ParseTableName = """" & sTabName & """"
+ ParseTableName = """" & TableName & """"
Case Else
- ParseTableName = sTabName
+ ParseTableName = TableName
End Select
End Function
+'---------------------------------------------------------------------------------------
+' Property: DateFormat
+'---------------------------------------------------------------------------------------
+'
+' DBMS specific date format
+'
+' Returns:
+' Format string
+'
+'---------------------------------------------------------------------------------------
Public Property Get DateFormat() As String
Select Case m_DBMSNAME
Case m_DBMSNAME_MSJET
@@ -1308,6 +1239,13 @@ Public Property Get DateFormat() As String
End Select
End Property
+'---------------------------------------------------------------------------------------
+' Property: WildCardString
+'---------------------------------------------------------------------------------------
+'
+' DBMS specific wildcard (like *)
+'
+'---------------------------------------------------------------------------------------
Public Property Get WildCardString() As String
Select Case m_DBMSNAME
Case m_DBMSNAME_MSJET
@@ -1325,6 +1263,13 @@ Public Property Get WildCardString() As String
End Select
End Property
+'---------------------------------------------------------------------------------------
+' Property: BooleanTrueString
+'---------------------------------------------------------------------------------------
+'
+' DBMS specific string for true
+'
+'---------------------------------------------------------------------------------------
Public Property Get BooleanTrueString() As String
Select Case m_DBMSNAME
Case m_DBMSNAME_MSJET
@@ -1342,21 +1287,16 @@ Public Property Get BooleanTrueString() As String
End Select
End Property
-
-
#If CONFIG_USELOGINFORM = 1 Then
'---------------------------------------------------------------------------------------
' Property: LoginFormName
'---------------------------------------------------------------------------------------
-'/**
-'
-' Name des Login-Formulars
-'
-' String
-'
-' Beispiel aus ACLib: \base\login\frmLogin.frm
-'
-'**/
+'
+' Name of the login form
+'
+' Remarks:
+' Example from ACLib: user/login/LoginForm.frm
+'
'---------------------------------------------------------------------------------------
Public Property Get LoginFormName() As String
If Len(m_LoginFormName) = 0 Then
@@ -1375,14 +1315,9 @@ End Property
'---------------------------------------------------------------------------------------
' Property: DbmsConfigFormName
'---------------------------------------------------------------------------------------
-'/**
-'
-' Name des Formulars zur DBMS-Konfiguration
-'
-' String
-'
-'
-'**/
+'
+' Name of the DBMS configuration form
+'
'---------------------------------------------------------------------------------------
Public Property Get DbmsConfigFormName() As String
DbmsConfigFormName = m_DbmsConfigFormName
@@ -1391,3 +1326,175 @@ End Property
Public Property Let DbmsConfigFormName(ByVal NewValue As String)
m_DbmsConfigFormName = NewValue
End Property
+
+
+Private Sub LoadConnectionData(Optional ByVal WithoutLoginForm As Boolean = False, Optional ByVal RaiseDbmsConnectionChangedEvent As Boolean = False)
+
+ Dim tempConnID As String
+
+ tempConnID = m_ConnectionIdentifier
+
+ ClearConnectionInfo
+
+ LoadConnectionDataFromTable
+
+ m_DbmsInfoReaded = True
+ m_SAVEPWD = (Len(m_DBUSERPWD) > 0) And (m_UseLoginForm = False)
+
+ If m_DBMSNAME = "MSJET" Then
+ m_DatabaseFile = m_DBNAME
+ End If
+
+ If Not WithoutLoginForm Then
+ If m_UseLoginForm Then 'ergibt Anmeldung, daher nicht für Vorabeinstellungen nutzen! (=>withoutLoginForm=true)
+#If CONFIG_USELOGINFORM = 1 Then
+ Dim LoginUserName As String
+ LoginUserName = GetUserNameFromConfigFile
+ If Len(LoginUserName) = 0 Then
+ LoginUserName = m_DBUSER
+ End If
+
+ 'm_LoginForm über Property LoginForm zugänglich machen und im LoginForm selbst setzen:
+ DoCmd.OpenForm LoginFormName, acNormal, , , acFormEdit, acDialog, ObjPtr(Me) & "@" & m_ConnectionIdentifier & "@" & LoginUserName
+#Else
+ Err.Raise vbObjectError, "DbConnectionInfo", "CONFIG_USELOGINFORM in Projekteigenschaften nicht gesetzt!"
+#End If
+ End If
+ End If
+
+ If (tempConnID <> m_ConnectionIdentifier) Or RaiseDbmsConnectionChangedEvent Then
+ RaiseEvent DbmsConnectionChanged(m_ConnectionIdentifier)
+ End If
+
+End Sub
+
+Private Sub LoadConnectionDataFromTable()
+
+ Dim rst As DAO.Recordset
+ Dim SelectSql As String
+ Dim Loa
+
+ If Len(m_ConnectionIdentifier) = 0 Then 'jenen DS auswählen, der als "Aktiv" gekennzeichnet wurde
+ SelectSql = ActivatedConnDataSelectSql
+ Else
+ SelectSql = Replace(SelectConnectionIdentifierConnDataSelectSql, "{ConnectionIdentifier}", SqlTools.TextToSqlText(m_ConnectionIdentifier))
+ End If
+
+ Set rst = CurrentDb.OpenRecordset(SelectSql, dbOpenSnapshot)
+ If rst.EOF Then
+
+ rst.Close
+ Set rst = Nothing
+
+ If Len(m_ConnectionIdentifier) = 0 Then 'es wurde noch keine Verbindung aktiviert
+ If Not TryGetConnectionDataWithConfigForm(rst) Then
+ Err.Raise DbConnectionInfoErrorNumbers.ERRNR_NODBMS, "DbConnectionInfo.LoadDbmsConnectionDataFromTable", "Es wurde keine Verbindung aktiviert."
+ Exit Sub
+ ElseIf m_DbmsInfoReaded Then
+ Exit Sub
+ End If
+ Else
+ Err.Raise DbConnectionInfoErrorNumbers.ERRNR_NODBMS, "DbConnectionInfo.LoadDbmsConnectionDataFromTable", "Kein Eintrag für '" & m_ConnectionIdentifier & "' gefunden"
+ Exit Sub
+ End If
+
+ End If
+
+ 'Read settings
+ LoadConnectionDataFromRecordset rst
+ rst.Close
+ Set rst = Nothing
+
+End Sub
+
+Private Function TryGetConnectionDataWithConfigForm(ByRef rst As DAO.Recordset) As Boolean
+
+ If Len(DbmsConfigFormName) > 0 Then
+
+ If MsgBox("Es wurde noch keine Verbindung aktiviert." & vbNewLine & _
+ "Bitte überprüfen Sie die Verbindungsparameter und aktivieren Sie die gewünschte Verbindung.", _
+ vbInformation + vbOKCancel) = vbOK Then
+
+ DoCmd.OpenForm DbmsConfigFormName, , , , , acDialog
+ 'Abbruch, falls über Formular bereits initialisiert wurde
+ If m_DbmsInfoReaded Then
+ TryGetConnectionDataWithConfigForm = True
+ Exit Function
+ End If
+
+ End If
+
+ Set rst = CurrentDb.OpenRecordset(ActivatedConnDataSelectSql, dbOpenSnapshot)
+ If Not rst.EOF Then
+ m_ConnectionIdentifier = Nz(rst.Fields("CID"), vbNullString)
+ TryGetConnectionDataWithConfigForm = True
+ Else
+ rst.Close
+ Set rst = Nothing
+ TryGetConnectionDataWithConfigForm = False
+ End If
+
+ End If
+
+End Function
+
+Private Sub LoadConnectionDataFromRecordset(ByVal rst As DAO.Recordset)
+
+ With rst
+ If Len(m_ConnectionIdentifier) = 0 Then
+ m_ConnectionIdentifier = Nz(rst.Fields("CID"), vbNullString)
+ If Len(m_ConnectionIdentifier) = 0 Then
+ Err.Raise DbConnectionInfoErrorNumbers.ERRNR_NODBMS, "DbConnectionInfo.readDBMSprop", "Es wurde keine Verbindung übergeben."
+ Exit Sub
+ End If
+ End If
+
+ m_DBMSNAME = Nz(rst.Fields("DBMS"), vbNullString)
+ m_CONNECTIONMODE = Nz(.Fields("dbmsConnectionMode"), 0) '1 = DNS less, 2 = DSN, 4 = benutzerdefiniert
+
+ m_DBNAME = .Fields("dbmsDatabase") & vbNullString
+
+ m_DBSERVER = .Fields("dbmsServer") & vbNullString
+ m_PORT = .Fields("dbmsPort") & vbNullString
+
+ m_TRUSTEDCONNECTION = Nz(.Fields("dbmsUseTrustedConnection"), False)
+ m_UseLoginForm = Nz(.Fields("dbmsUseLoginForm"), False)
+ m_DBUSER = .Fields("dbmsUser") & vbNullString
+ m_DBUSERPWD = .Fields("dbmsPwd") & vbNullString
+
+ 'Falls kein Name angegeben ist, Loginform aktivieren
+ If Not (m_UseLoginForm Or m_TRUSTEDCONNECTION) And Len(m_DBUSER) = 0 Then
+ m_UseLoginForm = (m_DBMSNAME <> "MSJET")
+ End If
+
+ m_DSN = .Fields("dbmsDSN") & vbNullString
+
+ m_DBOLEDBPROVIDER = .Fields("dbmsOleDbProvider") & vbNullString
+ m_DBOPTIONS_OLEDB = .Fields("dbmsOptionsOLEDB") & vbNullString
+
+ m_DBODBCDRIVER = .Fields("dbmsOdbcDriver") & vbNullString
+ m_DBOPTIONS_ODBC = .Fields("dbmsOptionsODBC") & vbNullString
+
+ m_OledbConnectionString = .Fields("dbmsConStrOLEDB") & vbNullString
+ m_OdbcConnectionString = .Fields("dbmsConStrODBC") & vbNullString
+
+ End With
+
+End Sub
+
+Private Function GetUserNameFromConfigFile() As String
+
+ Dim ReturnStr As String * 1280
+ Dim RetVal As Long
+
+On Error Resume Next
+
+ RetVal = GetPrivateProfileString("Login", "UserName", vbNullString & vbNullChar, ReturnStr, Len(ReturnStr), CurrentProject.Path & "\" & m_ConnectionIdentifier & ".ini")
+ GetUserNameFromConfigFile = Trim(Left(ReturnStr, RetVal))
+
+End Function
+
+Private Sub SaveUserNameToConfigFile(ByVal UserName As String)
+On Error Resume Next
+ WritePrivateProfileString "Login", "UserName", UserName, CurrentProject.Path & "\" & m_ConnectionIdentifier & ".ini"
+End Sub
diff --git a/source/codelib/data/DbConnectionManager.cls b/source/codelib/data/DbConnectionManager.cls
index c91f503..59e1d2b 100644
--- a/source/codelib/data/DbConnectionManager.cls
+++ b/source/codelib/data/DbConnectionManager.cls
@@ -8,14 +8,19 @@ Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'---------------------------------------------------------------------------------------
-' Klassenmodul: DbConnectionManager
+' Class: data.DbConnectionManager
'---------------------------------------------------------------------------------------
-'/**
-'
-' Klasse zur Instanzierung, Terminierung und Basissteuerung von Hilfsklassen
-'
-' In dieser Klasse wird u. a. auf die Ereignisse der DbConnectionInfo- u. DbConnectionHandler-Instanz reagiert
-'**/
+'
+' Class for instantiation, termination and basic control of data access classes
+'
+' Author:
+' Josef Poetzl
+'
+' Remarks:
+' This class reacts to the events of the and instance.
+'
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
'
' data/DbConnectionManager.cls
@@ -24,18 +29,18 @@ Attribute VB_Exposed = False
'
'
'
-' DAO50{00025E01-0000-0000-C000-000000000046}
+' DAO120{4AC9E1DA-5BAD-4AC7-86E3-24F4CDCECA28}
'
'---------------------------------------------------------------------------------------
'
Option Compare Text
Option Explicit
-'Verbindungsparameter
+'Connection parameters
Private WithEvents m_DbConnectionInfo As DbConnectionInfo
Attribute m_DbConnectionInfo.VB_VarHelpID = -1
-'DB-Verbindung
+'DB connection
Private WithEvents m_DbConnection As DbConnectionHandler
Attribute m_DbConnection.VB_VarHelpID = -1
@@ -51,6 +56,13 @@ On Error Resume Next
Dispose
End Sub
+'---------------------------------------------------------------------------------------
+' Sub: Dispose
+'---------------------------------------------------------------------------------------
+'
+' Remove object references
+'
+'---------------------------------------------------------------------------------------
Public Sub Dispose()
On Error Resume Next
@@ -66,6 +78,34 @@ On Error Resume Next
End Sub
+'---------------------------------------------------------------------------------------
+' Function: CheckConnectionStatus
+'---------------------------------------------------------------------------------------
+'
+' Test whether a connection can be established
+'
+' Returns:
+' Boolean - True if success
+'
+'---------------------------------------------------------------------------------------
+Public Function CheckConnectionStatus() As Boolean
+
+On Error Resume Next
+
+ CheckConnectionStatus = ConnectionInfo.CheckConnection
+
+End Function
+
+'---------------------------------------------------------------------------------------
+' Property: DefaultSettings
+'---------------------------------------------------------------------------------------
+'
+' Test whether a connection can be established
+'
+' Returns:
+'
+'
+'---------------------------------------------------------------------------------------
Public Property Get DefaultSettings() As DbConnectionSettings
If m_DefaultDbConnecionSettings Is Nothing Then
Set m_DefaultDbConnecionSettings = New DbConnectionSettings
@@ -75,7 +115,6 @@ Public Property Get DefaultSettings() As DbConnectionSettings
Set DefaultSettings = m_DefaultDbConnecionSettings
End Property
-
Private Sub DisposePermanentBackendRst()
On Error Resume Next
If Not (m_PermanentBackendRst Is Nothing) Then
@@ -84,39 +123,18 @@ On Error Resume Next
End If
End Sub
-'---------------------------------------------------------------------------------------
-' Function: CheckConnectionStatus
-'---------------------------------------------------------------------------------------
-'/**
-'
-' Testen, ob Verbindungsaufbau möglich ist
-'
-' Boolean: True = Verbindungsaufbau war erfolgreich
-'
-'
-'**/
-'---------------------------------------------------------------------------------------
-Public Function CheckConnectionStatus() As Boolean
-
-On Error Resume Next
-
- CheckConnectionStatus = ConnectionInfo.CheckConnection
-
-End Function
-
-
'---------------------------------------------------------------------------------------
' Property: ConnectionInfo
'---------------------------------------------------------------------------------------
-'/**
-'
-' DbConnectionInfo-Instanz der Anwendung.
-'
-' DbConnectionInfo
-'
-' Dient zum Ausgeben von Informationen zur Datenbankverbindung
-'
-'**/
+'
+' DbConnectionInfo instance
+'
+' Returns:
+'
+'
+' Remarks:
+' Used to output information on the database connection
+'
'---------------------------------------------------------------------------------------
Public Property Get ConnectionInfo() As DbConnectionInfo
@@ -131,15 +149,15 @@ End Property
'---------------------------------------------------------------------------------------
' Property: DbConnection
'---------------------------------------------------------------------------------------
-'/**
-'
-' DbConnectionHandler-Instanz = oberste Ebene der Zugriffsstruktur
-'
-' DbConnectionHandler
-'
-' Kapselt ADODB- und DAO-Methoden sowie ODBC-Zugriffe
-'
-'**/
+'
+' DbConnectionHandler instance = Top level of the data access structure
+'
+' Returns:
+'
+'
+' Remarks:
+' Encapsulates ADODB and DAO methods as well as ODBC accesses
+'
'---------------------------------------------------------------------------------------
Public Property Get DbConnection() As DbConnectionHandler
@@ -217,9 +235,9 @@ Private Sub OpenPermanentBackendRecordset()
End Sub
-' ########################################################################################
+'########################################################################################
'
-' Ereignisbehandlung
+' Event handling
'
' DbConnectioninfo
'
diff --git a/source/codelib/data/DbConnectionSettings.cls b/source/codelib/data/DbConnectionSettings.cls
index c24f54c..398622c 100644
--- a/source/codelib/data/DbConnectionSettings.cls
+++ b/source/codelib/data/DbConnectionSettings.cls
@@ -8,14 +8,16 @@ Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'---------------------------------------------------------------------------------------
-' Klassenmodul: DbConnectionSettings
+' Class: data.DbConnectionSettings
'---------------------------------------------------------------------------------------
-'/**
-'
-' Hilfsklasse zum Zwischenspeichern der Verbindungsparameter
-'
-'
-'**/
+'
+' Auxiliary class for caching the connection parameters
+'
+' Author:
+' Josef Poetzl
+'
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
'
' data/DbConnectionSettings.cls
@@ -27,17 +29,60 @@ Attribute VB_Exposed = False
Option Compare Database
Option Explicit
-'SqlTools-Parameter
+'SqlTools parameter
+
+'---------------------------------------------------------------------------------------
+' Property: SqlDateFormat
+'---------------------------------------------------------------------------------------
+'
+' Date format string
+'
+'---------------------------------------------------------------------------------------
Public SqlDateFormat As String
+
+'---------------------------------------------------------------------------------------
+' Property: SqlWildCardString
+'---------------------------------------------------------------------------------------
+'
+' SQL wildcard
+'
+'---------------------------------------------------------------------------------------
Public SqlWildCardString As String
+
+'---------------------------------------------------------------------------------------
+' Property: SqlBooleanTrueString
+'---------------------------------------------------------------------------------------
+'
+' SQL string for boolean true
+'
+'---------------------------------------------------------------------------------------
Public SqlBooleanTrueString As String
-'AdodbHandler-Parameter
+'---------------------------------------------------------------------------------------
+' Property: DefaultAdodbCursorLocation
+'---------------------------------------------------------------------------------------
+'
+' Default parameter value for ADODB.CursorLocationEnum
+'
+'---------------------------------------------------------------------------------------
Public DefaultAdodbCursorLocation As ADODB.CursorLocationEnum
-'Datenzugriffssteuerung
+'---------------------------------------------------------------------------------------
+' Property: OpenPermanentBackendRecordset
+'---------------------------------------------------------------------------------------
+'
+' Open permanent backend recordset if connected
+'
+'---------------------------------------------------------------------------------------
Public OpenPermanentBackendRecordset As Boolean
+'---------------------------------------------------------------------------------------
+' Property: Clone
+'---------------------------------------------------------------------------------------
+'
+' Clone of current config
+'
+'---------------------------------------------------------------------------------------
Public Function Clone() As DbConnectionSettings
Dim NewObject As DbConnectionSettings
Set NewObject = New DbConnectionSettings
@@ -45,6 +90,16 @@ Public Function Clone() As DbConnectionSettings
Set Clone = NewObject
End Function
+'---------------------------------------------------------------------------------------
+' Property: CopyFrom
+'---------------------------------------------------------------------------------------
+'
+' Copy DbConnectionSettings
+'
+' Parameters:
+' NewSettings - DbConnectionSettings to copy
+'
+'---------------------------------------------------------------------------------------
Public Sub CopyFrom(ByVal NewSettings As DbConnectionSettings)
With NewSettings
diff --git a/source/codelib/data/SqlTools.cls b/source/codelib/data/SqlTools.cls
index 66462ac..ddb6282 100644
--- a/source/codelib/data/SqlTools.cls
+++ b/source/codelib/data/SqlTools.cls
@@ -7,21 +7,23 @@ Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
-'Attribute VB_PredeclaredId = True
'---------------------------------------------------------------------------------------
-' Klasse: SqlTools
+' Class: data.sql.SqlTools
'---------------------------------------------------------------------------------------
-'/**
-' \author Josef Poetzl
-'
-' SQL Tools: Functions to build sql strings
-'
-' Set "Attribute VB_PredeclaredId = True" to enable using SqlTools without explicit instantiation.
+' Functions to build sql strings
'
-' \warning Don't forget to set parameters for date format, boolean, and wild card for the DBMS.
+' Author:
+' Josef Poetzl
'
-' \ingroup data
-'**/
+' Remarks:
+' "Attribute VB_PredeclaredId = True" to enable using SqlTools without explicit instantiation.
+'
+' Warning:
+'
+'| Don't forget to set parameters for date format, boolean and wildcard for the DBMS.
+'
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
'
' data/SqlTools.cls
@@ -39,7 +41,7 @@ Private Enum SqlToolsErrorNumbers
ERRNR_NOCONFIG = vbObjectError + 1
End Enum
-' Standard-Werte für Methodenparameter
+' Default values for method parameters
Private Const SQL_DEFAULT_TEXTDELIMITER As String = "'"
Private Const SQL_DEFAULT_DATEFORMAT As String = "" ' "" => SqlDateFormat property will use.
' To disable, enter value (e.g. "\#yyyy-mm\-dd\#"),
@@ -88,16 +90,101 @@ Public Enum SqlLogicalOperator
SQL_CommaSeparator = 3
End Enum
-' SQL dialect presets
+'##################################
+' Group: Class support
+
+'---------------------------------------------------------------------------------------
+' Function: Clone
+'---------------------------------------------------------------------------------------
+'
+' Create a new instance with basic settings of the current instance.
+'
+' Parameters:
+'
+' NewSqlDateFormat - use this date format instead of base instance
+' NewSqlBooleanTrueString - use this text for true instead of base instance
+' NewSqlWildCardString - use this wildcard string instead of base instance
+'
+' Returns:
+'
+' SqlTools instance with config form base
+'
+' See Also:
+' NewInstance
+'
+'---------------------------------------------------------------------------------------
+Public Function Clone(Optional ByVal NewSqlDateFormat As String = SQL_DEFAULT_DATEFORMAT, _
+ Optional ByVal NewSqlBooleanTrueString As String = SQL_DEFAULT_BOOLTRUESTRING, _
+ Optional ByVal NewSqlWildCardString As String = SQL_DEFAULT_WILDCARD) As SqlTools
+
+
+ If Len(NewSqlDateFormat) = 0 Then NewSqlDateFormat = Me.SqlDateFormat
+ If Len(NewSqlBooleanTrueString) = 0 Then NewSqlBooleanTrueString = Me.SqlBooleanTrueString
+ If Len(NewSqlWildCardString) = 0 Then NewSqlWildCardString = Me.SqlWildCardString
+
+ Set Clone = NewInstance(NewSqlDateFormat, NewSqlBooleanTrueString, NewSqlWildCardString)
+
+End Function
+
+'---------------------------------------------------------------------------------------
+' Function: NewInstance
+'---------------------------------------------------------------------------------------
+'
+' Create a new instance
+'
+'---------------------------------------------------------------------------------------
+Public Function NewInstance(ByVal NewSqlDateFormat As String, _
+ ByVal NewSqlBooleanTrueString As String, _
+ ByVal NewSqlWildCardString As String) As SqlTools
+
+ Dim NewInst As SqlTools
+
+ Set NewInst = New SqlTools
+ With NewInst
+ .SqlDateFormat = NewSqlDateFormat
+ .SqlBooleanTrueString = NewSqlBooleanTrueString
+ .SqlWildCardString = NewSqlWildCardString
+ End With
+
+ Set NewInstance = NewInst
+
+End Function
+
+
+'##################################
+' Group: SQL dialect preferences
+
+'---------------------------------------------------------------------------------------
+' Property: DAO
+'---------------------------------------------------------------------------------------
+'
+' SqlTools instance configured for DAO-SQL (Jet/ACE)
+'
+'---------------------------------------------------------------------------------------
Public Property Get DAO() As SqlTools
- Set DAO = Me.Clone("\#yyyy-mm-dd hh:nn:ss\#", "True", "*")
+ Set DAO = Me.NewInstance("\#yyyy-mm-dd hh:nn:ss\#", "True", "*")
End Property
+'---------------------------------------------------------------------------------------
+' Property: TSql
+'---------------------------------------------------------------------------------------
+'
+' SqlTools instance configured for T-SQL
+'
+'---------------------------------------------------------------------------------------
Public Property Get TSql() As SqlTools
- Set TSql = Me.Clone("'yyyymmdd hh:nn:ss'", "1", "%")
+ Set TSql = Me.NewInstance("'yyyymmdd hh:nn:ss'", "1", "%")
End Property
' Configuration for SQL dialect
+
+'---------------------------------------------------------------------------------------
+' Property: SqlWildCardString
+'---------------------------------------------------------------------------------------
+'
+' Wildcard character for like
+'
+'---------------------------------------------------------------------------------------
Public Property Get SqlWildCardString() As String
If Len(m_SqlWildCardString) > 0 Then
SqlWildCardString = m_SqlWildCardString
@@ -110,6 +197,13 @@ Public Property Let SqlWildCardString(ByVal NewValue As String)
m_SqlWildCardString = NewValue
End Property
+'---------------------------------------------------------------------------------------
+' Property: SqlDateFormat
+'---------------------------------------------------------------------------------------
+'
+' Format for date values
+'
+'---------------------------------------------------------------------------------------
Public Property Get SqlDateFormat() As String
If Len(m_SqlDateFormat) > 0 Then
SqlDateFormat = m_SqlDateFormat
@@ -122,6 +216,13 @@ Public Property Let SqlDateFormat(ByVal NewValue As String)
m_SqlDateFormat = NewValue
End Property
+'---------------------------------------------------------------------------------------
+' Property: SqlBooleanTrueString
+'---------------------------------------------------------------------------------------
+'
+' Boolean string in SQL statement
+'
+'---------------------------------------------------------------------------------------
Public Property Get SqlBooleanTrueString() As String
If Len(m_SqlBooleanTrueString) > 0 Then
SqlBooleanTrueString = m_SqlBooleanTrueString
@@ -134,76 +235,25 @@ Public Property Let SqlBooleanTrueString(ByVal NewValue As String)
m_SqlBooleanTrueString = NewValue
End Property
-'---------------------------------------------------------------------------------------
-' Function: Clone
-'---------------------------------------------------------------------------------------
-'/**
-'
-' Create a new instance with basic settings of the current instance.
-'
-' SqlTools
-'
-'
-'**/
-'---------------------------------------------------------------------------------------
-Public Function Clone(Optional ByVal NewSqlDateFormat As String = SQL_DEFAULT_DATEFORMAT, _
- Optional ByVal NewSqlBooleanTrueString As String = SQL_DEFAULT_BOOLTRUESTRING, _
- Optional ByVal NewSqlWildCardString As String = SQL_DEFAULT_WILDCARD) As SqlTools
-
-
- If Len(NewSqlDateFormat) = 0 Then NewSqlDateFormat = Me.SqlDateFormat
- If Len(NewSqlBooleanTrueString) = 0 Then NewSqlBooleanTrueString = Me.SqlBooleanTrueString
- If Len(NewSqlWildCardString) = 0 Then NewSqlWildCardString = Me.SqlWildCardString
-
- Set Clone = NewInstance(NewSqlDateFormat, NewSqlBooleanTrueString, NewSqlWildCardString)
-
-End Function
-
-'---------------------------------------------------------------------------------------
-' Function: NewInstance
-'---------------------------------------------------------------------------------------
-'/**
-'
-' Create a new instance
-'
-' String
-'
-'
-'**/
-'---------------------------------------------------------------------------------------
-Public Function NewInstance(ByVal NewSqlDateFormat As String, _
- ByVal NewSqlBooleanTrueString As String, _
- ByVal NewSqlWildCardString As String) As SqlTools
-
- Dim NewInst As SqlTools
-
- Set NewInst = New SqlTools
- With NewInst
- .SqlDateFormat = NewSqlDateFormat
- .SqlBooleanTrueString = NewSqlBooleanTrueString
- .SqlWildCardString = NewSqlWildCardString
- End With
-
- Set NewInstance = NewInst
-
-End Function
+'##################################
+' Group: BuildCriteria
'---------------------------------------------------------------------------------------
' Function: BuildCriteria
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Create SQL criteria string
-'
-' Field name in the data source to be filtered
-' Relational operator (=, <=, etc.)
-' Filter value (can be a single value or an array of values)
-' Optional 2nd filter value (for Between)
-' The value for which no filter condition is to be created. (Array transfer of values possible)
-' String
-'
-'
-'**/
+'
+' Parameters:
+' FieldName - Field name in the data source to be filtered
+' RelationalOperator - Relational operator (=, <=, etc.)
+' FilterValue - Filter value (can be a single value or an array of values)
+' FilterValue2 - Optional 2nd filter value (for Between)
+' IgnoreValue - The value for which no filter condition is to be created. (Array transfer of values possible)
+'
+' Returns:
+' SQL criteria string
+'
'---------------------------------------------------------------------------------------
Public Function BuildCriteria(ByVal FieldName As String, ByVal FieldDataType As SqlFieldDataType, _
ByVal RelationalOperator As SqlRelationalOperators, _
@@ -350,17 +400,22 @@ Public Function BuildCriteria(ByVal FieldName As String, ByVal FieldDataType As
End Function
+'##################################
+' Group: Convert to SQL
+
'---------------------------------------------------------------------------------------
-' Function: DateToSqlText
+' Function: ConvertToSqlText
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Convert values to string for SQL statement assembled by VBA.
-'
-' Value to convert
-' Data type of the value to be converted
-' String
-'**/
+'
+' Parameters:
+' Value - Value to convert
+' FieldDataType - Data type of the value to be converted
+'
+' Returns:
+' String - SQL conform string
+'
'---------------------------------------------------------------------------------------
Public Function ConvertToSqlText(ByVal Value As Variant, _
ByVal FieldDataType As SqlFieldDataType) As String
@@ -383,19 +438,21 @@ End Function
'---------------------------------------------------------------------------------------
' Function: TextToSqlText
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Prepare text for SQL statement
-'
-' Value to convert
-' Delimiter for text values. (In most DBMS ' is used as a delimiter).
-' Only double the boundary drawing within the values, but do not set the boundary.
-' String
-'
-' Example: strSQL = "select ... from tabelle where Feld = " & TextToSqlText("ab'cd")
-' => strSQL = "select ... from tabelle where Feld = 'ab''cd'"
-'
-'**/
+'
+' Parameters:
+' Value - Value to convert
+' Delimiter - Delimiter for text values. (In most DBMS ' is used as a delimiter).
+' WithoutLeftRightDelim - Only double the boundary drawing within the values, but do not set the boundary.
+'
+' Returns:
+' String
+'
+' Example:
+' strSQL = "select ... from tabelle where Feld = " & TextToSqlText("ab'cd")
+' => strSQL = "select ... from tabelle where Feld = 'ab''cd'"
+'
'---------------------------------------------------------------------------------------
Public Function TextToSqlText(ByVal Value As Variant, _
Optional ByVal Delimiter As String = SQL_DEFAULT_TEXTDELIMITER, _
@@ -420,14 +477,16 @@ End Function
'---------------------------------------------------------------------------------------
' Function: DateToSqlText
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Convert date value to string for SQL statement assembled by VBA.
-'
-' Value to convert
-' Date format (depends on DBMS!)
-' String
-'**/
+'
+' Parameters:
+' Value - Value to convert
+' FormatString - Date format (depends on DBMS!)
+'
+' Returns:
+' String
+'
'---------------------------------------------------------------------------------------
Public Function DateToSqlText(ByVal Value As Variant, _
Optional ByVal FormatString As String = SQL_DEFAULT_DATEFORMAT) As String
@@ -455,16 +514,19 @@ End Function
'---------------------------------------------------------------------------------------
' Function: NumberToSqlText
'---------------------------------------------------------------------------------------
-'/**
-'
-' Zahl für SQL-Text aufbereiten
-'
-' Value to convert
-' String
-'
-' Str function ensures ".".
-'
-'**/
+'
+' Convert numeric value to string for SQL statement assembled by VBA.
+'
+' Parameters:
+' Value - Value to convert
+' FormatString - Date format (depends on DBMS!)
+'
+' Returns:
+' String
+'
+' Remarks:
+' Str function ensures ".".
+'
'---------------------------------------------------------------------------------------
Public Function NumberToSqlText(ByVal Value As Variant) As String
@@ -524,15 +586,16 @@ End Function
'---------------------------------------------------------------------------------------
' Function: BooleanToSqlText
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Prepare Boolean for SQL text
-'
-' Value to convert
-' String
-'
-'
-'**/
+'
+' Parameters:
+' Value - Value to convert
+' TrueString - String for true value (optional)
+'
+' Returns:
+' String
+'
'---------------------------------------------------------------------------------------
Public Function BooleanToSqlText(ByVal Value As Variant, _
Optional ByVal TrueString As String = SQL_DEFAULT_BOOLTRUESTRING) As String
diff --git a/source/codelib/data/ado/AdodbHandler.cls b/source/codelib/data/ado/AdodbHandler.cls
index ec338a3..e543f21 100644
--- a/source/codelib/data/ado/AdodbHandler.cls
+++ b/source/codelib/data/ado/AdodbHandler.cls
@@ -8,16 +8,16 @@ Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'---------------------------------------------------------------------------------------
-' Class: AdodbHandler
+' Class: data.adodb.AdodbHandler
'---------------------------------------------------------------------------------------
-'/**
-' \author Josef Poetzl
-'
-' ADODB-Zugriffsmethoden
-'
-'
-'\ingroup data_adodb
-'**/
+'
+' ADODB data connection methods
+'
+' Author:
+' Josef Poetzl
+'
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
'
' data/ado/AdodbHandler.cls
@@ -36,49 +36,76 @@ Private m_AdoConnection As ADODB.Connection
'ADO-Connectionstring
Private m_AdoConnectionString As String
-'Error-Events für mögliche Fehlerbehandlung über die FE-Anwendung
-'/**
-'
-' Ereignis für fehlende ADODB-Connection-Referenz
-'
-' Meldung über Ursache der Ereignisauslösung. (Wird noch nicht genutzt)
-' ADODB.Connection-Referenz, die für CurrentConnection verwendet werden soll
-'
-' Über den ByRef-Parameter NewCurrentConnection kann die passende ADODB.Database-Referenz weitergegeben werden.
-' Eine Referenz-Weitergabe ist allerdings nicht zwingend erforderlich, da z. B. in der Methode #CurrentConnection
-' die Connection dann aus dem #ConnectionString erstellt wird.
-'
-'**/
+'#############################################################
+' Group: Events
+
+'---------------------------------------------------------------------------------------
+' Event: ErrorMissingCurrentConnection
+'---------------------------------------------------------------------------------------
+'
+' Event for missing ADODB connection reference
+' (Passing the AdodbHandler event: )
+'
+' Parameters:
+' Msg - Message about the cause of the event triggering. (Not yet used)
+' NewCurrentConnection - ADODB.Connectionreference to be used for CurrentConnection
+'
+' Remarks:
+' The appropriate ADODB.Database reference can be passed on via the ByRef parameter NewCurrentConnection.
+' However, passing on a reference is not mandatory, since, it is stored in the AdodbHandler property .
+' The connection is then created from the
+'
+'---------------------------------------------------------------------------------------
Public Event ErrorMissingCurrentConnection(ByVal Msg As String, ByRef NewCurrentConnection As ADODB.Connection)
-'/**
-'
-' Ereignis für fehlenden OLEDB-Connectionstring
-'
-' Meldung über Ursache der Ereignisauslösung. (Wird noch nicht genutzt)
-' OLEDB-Connectionstring
-' über den ByRef-Parameter NewConnectionString kann der passende OLEDB-Connectionstring weitergegeben werden.
-'**/
+'---------------------------------------------------------------------------------------
+' Event: ErrorEmptyOledbConnectionString
+'---------------------------------------------------------------------------------------
+'
+' Event for missing OLEDB connection string
+'
+' Parameters:
+' Msg - Message about the cause of the event triggering. (Not yet used)
+' NewConnectionString - OLEDB Connectionstring
+'
+' Remarks:
+' The appropriate OLEDB connection string can be passed on via the ByRef parameter NewConnectionString.
+'
+'---------------------------------------------------------------------------------------
Public Event ErrorEmptyConnectionString(ByVal Msg As String, ByRef NewConnectionString As String)
-
+'---------------------------------------------------------------------------------------
+' Event: HookInsertIdentityReturn
+'---------------------------------------------------------------------------------------
+'
+' Event for missing OLEDB connection string
+'
+' Parameters:
+' InsertSql - SQL text of insert statement
+' IdentityTable - Identity table
+' ActiveConnection - ADODB Connection to use
+' IdentitySelectString - Input string to use
+' HookResponseMode - resume action after event call: 0 ... code resume after event, 1 exit function after event
+' HookResponseMessage - return value of function (e.g. InsertIdentityReturn) when HookResumeMode <> 0
+'
+' Remarks:
+' New values can be passed on via the ByRef parameters.
+'
+'---------------------------------------------------------------------------------------
Public Event HookInsertIdentityReturn(ByRef InsertSql As String, ByRef IdentityTable As String, _
ByRef ActiveConnection As ADODB.Connection, ByRef IdentitySelectString As String, _
- ByRef HookResumeMode As Long, ByRef HookResumeMessage As Variant)
+ ByRef HookResponseMode As Long, ByRef HookResponseMessage As Variant)
Private m_HooksEnabled As Boolean
Private m_DefaultCursorLocation As ADODB.CursorLocationEnum
-'Private Type AdodbCommandParamDef
-' ParamName As String
-' ParamValue As Variant
-'End Type
+'#############################################################
+' Group: Class control
'
' Init / Terminate
' ----------------
-
Private Sub Class_Initialize()
m_DefaultCursorLocation = adUseServer
End Sub
@@ -91,6 +118,15 @@ Public Sub Dispose()
Set m_AdoConnection = Nothing
End Sub
+'---------------------------------------------------------------------------------------
+' Property: HooksEnabled
+'---------------------------------------------------------------------------------------
+' Active Hooks
+'
+' Remarks:
+' Used in InsertIdentityReturn
+'
+'---------------------------------------------------------------------------------------
Public Property Get HooksEnabled() As Boolean
HooksEnabled = m_HooksEnabled
End Property
@@ -107,36 +143,38 @@ Public Property Let DefaultCursorLocation(ByVal NewValue As ADODB.CursorLocation
m_DefaultCursorLocation = NewValue
End Property
-
+'#############################################################
+' Group: Data Connection
'---------------------------------------------------------------------------------------
-' Property: CurrentConnection (2009-08-06)
+' Property: CurrentConnection
'---------------------------------------------------------------------------------------
-'/**
-'
-' Aktuell eingestellte ADODB-Connction
-'
-' ADODB.Connection
-'
-' Falls noch keine ADODB-Connection vorhanden ist, wird eine neue ADODB-Verbindung erstellt.
-' Ablauf der Instanzieren:
-' 1. RaiseEvent #ErrorMissingCurrentConnection ... falls keine Connection übergeben wurde:
-' 2. Neue ADODB-Connection auf Basis des OLEDB-Connectionstring erzeugen (Einsatz der Eigenschaft #ConnectionString)
'
-' Falls bereits eine Referenz zu einer ADODB-Connection vorhanden ist, wird geprüft, ob diese geschlossen ist und im Bedarfsfall geöffnet.
-'
-'**/
+' Get:
+' Currently set ADODB connection
+'
+' Set:
+' Set new ADODB connection
+'
+' Remarks:
+' If there is no ADODB connection yet, a new ADODB connection will be created.
+' Instantiation flow:
+' 1. raiseEvent #ErrorMissingCurrentConnection ... if no connection was passed:
+' 2. create new ADODB connection based on the OLEDB connection string (use property )
+'
+' If a reference to an ADODB connection already exists, it will be checked if it is closed and opened if necessary.
+'
'---------------------------------------------------------------------------------------
Public Property Get CurrentConnection() As ADODB.Connection
Dim strConnString As String
If (m_AdoConnection Is Nothing) Then
- 'Connection über Event anfordern.
+ 'Request connection via event.
RaiseEvent ErrorMissingCurrentConnection("Unavailable CurrentConnection", m_AdoConnection)
If (m_AdoConnection Is Nothing) Then
- 'Neue Verbindung einstellen, falls durch Event keine Connection übergeben wurde
- strConnString = ConnectionString '... siehe Property ConnectionString
+ 'Set new connection if no connection was passed by event
+ strConnString = ConnectionString
If Len(strConnString) > 0 Then
Set m_AdoConnection = New ADODB.Connection
m_AdoConnection.Open strConnString
@@ -145,7 +183,7 @@ Public Property Get CurrentConnection() As ADODB.Connection
ElseIf (m_AdoConnection.State <> ObjectStateEnum.adStateOpen) Then
If Len(m_AdoConnection.ConnectionString) > 0 Then
m_AdoConnection.Open
- Else 'neu verbinden
+ Else '(re)open connection
m_AdoConnection.Open ConnectionString
End If
End If
@@ -153,17 +191,6 @@ Public Property Get CurrentConnection() As ADODB.Connection
End Property
-'---------------------------------------------------------------------------------------
-' Property: CurrentConnection
-'---------------------------------------------------------------------------------------
-'/**
-'
-' Übergabe einer ADODB-Connection
-'
-' Neue ADODB-Connection
-'
-'**/
-'---------------------------------------------------------------------------------------
Public Property Set CurrentConnection(ByRef NewConnection As ADODB.Connection)
If Not (m_AdoConnection Is Nothing) Then
If m_AdoConnection.State <> adStateClosed Then
@@ -177,13 +204,9 @@ End Property
'---------------------------------------------------------------------------------------
' Property: ConnectionString
'---------------------------------------------------------------------------------------
-'/**
-'
-' OLEDB-Connectionstring
-'
-' OLEDB-Connectionstring
-'
-'**/
+'
+' OLEDB connection string
+'
'---------------------------------------------------------------------------------------
Public Property Get ConnectionString() As String
If Len(m_AdoConnectionString) = 0 Then
@@ -191,42 +214,37 @@ Public Property Get ConnectionString() As String
m_AdoConnectionString = m_AdoConnection.ConnectionString
End If
If Len(m_AdoConnectionString) = 0 Then
- 'Connectiostring mittels Event abfragen
- RaiseEvent ErrorEmptyConnectionString("DbConnection.ConnectionString", m_AdoConnectionString)
+ RaiseEvent ErrorEmptyConnectionString("AdodbHandler.ConnectionString", m_AdoConnectionString)
End If
End If
ConnectionString = m_AdoConnectionString
End Property
-'---------------------------------------------------------------------------------------
-' Property: ConnectionString
-'---------------------------------------------------------------------------------------
-'/**
-'
-' OLEDB-Connectionstring
-'
-' OLEDB-Connectionstring für den Verbindungaufbau
-'
-'**/
-'---------------------------------------------------------------------------------------
Public Property Let ConnectionString(ByVal Value As String)
Set CurrentConnection = Nothing
m_AdoConnectionString = Value
End Property
+'#############################################################
+' Group: Data Operations
+
'---------------------------------------------------------------------------------------
' Function: Execute
'---------------------------------------------------------------------------------------
-'/**
-'
-' Sql-Anweisung ausführen
-'
-' SQL-Anweisung
-' ByRef-Parameter zur Rückgabe der Anzahl der von der Execute-Anweisung betroffenen Datensätze
-' zusätztliche Optionen der ADODB.Connection-Execute-Methode
-' ADODB.Recordset
-' Kapselung der ADODB.Connection.Execute-Methode (Parameter werden 1:1 weitergereicht)
-'**/
+'
+' Execute SQL statement
+'
+' Parameters:
+' CommandText - SQL statement
+' RecordsAffected - ByRef parameter to return the number of records affected by the Execute statement.
+' Options - additional options of the ADODB.Connection.Execute method
+'
+' Returns:
+' ADODB.Recordset
+'
+' Remarks:
+' Encapsulation of the ADODB.Connection.Execute method (parameters are passed on 1:1)
+'
'---------------------------------------------------------------------------------------
Public Function Execute(ByVal CommandText As String, _
Optional ByRef RecordsAffected As Long, _
@@ -237,26 +255,31 @@ End Function
'---------------------------------------------------------------------------------------
' Function: ExecuteCommand
'---------------------------------------------------------------------------------------
-'/**
-'
-' Sql-Anweisung mittels ADODB.Command ausführen
-'
-' ADODB.CommandText-Wert
-' ADODB.CommandType-Wert
-' 2-dimensionales Parameter-Array (Array(n,1) ... x(n,0) = Parametername, x(n,1) = Parameterwert)
-' ByRef-Parameter zur Rückgabe der Anzahl der von der Execute-Anweisung betroffenen Datensätze
-' zusätztliche Optionen der ADODB.Connection-Execute-Methode
-' ADODB.Recordset
-' Mit dieser Variante kann sehr einfach SQL-Injection vermieden werden, da die Parameter nicht direkt in der SQL-Anweisung eingebaut sind und somit ein Parameterwert (der z. B. von einer Benutzereingabe stammt) keine SQL-Anweisung einschleusen kann.
-'**/
+'
+' Execute sql statement using ADODB.Command
+'
+' Parameters:
+' CmdText - ADODB.CommandText value
+' CmdType - ADODB.CommandType value
+' CmdParamDefs - 2-dimensional parameter array (Array(n,1) ... x(n,0) = parameter name, x(n,1) = parameter value)
+' RecordsAffected - ByRef parameter to return the number of records affected by the Execute statement.
+' Options - additional options of the ADODB.Command.Execute method
+'
+' Returns:
+' ADODB.Recordset
+'
+' Remarks:
+' With this variant, SQL injection can be avoided very easily,
+' since the parameters are not built directly into the SQL statement
+' and thus a parameter value (which comes from a user input, for example) cannot inject an SQL statement.
+'
'---------------------------------------------------------------------------------------
Public Function ExecuteCommand(ByVal CmdText As String, _
ByVal CmdType As ADODB.CommandTypeEnum, _
Optional ByVal CmdParamDefs As Variant, _
Optional ByRef RecordsAffected As Long, _
Optional ByVal Options As Long = -1) As ADODB.Recordset
-'gibt geöffnetes ADODB-Recordset zurück
-
+
Dim cmd As ADODB.Command
Dim ParamDefsArraySize As Long
Dim i As Long
@@ -287,28 +310,27 @@ Public Function ExecuteCommand(ByVal CmdText As String, _
End Function
'---------------------------------------------------------------------------------------
-' Function: OpenRecordset (2009-07-25)
+' Function: OpenRecordset
'---------------------------------------------------------------------------------------
-'/**
-'
-' OpenRecordset
-'
-' Datenquelle (z.B. SQL-Anweisung)
-' ADODB.CursorTypeEnum-Wert
-' ADODB.LockTypeEnum-Wert
-' ADODB.CursorLocationEnum-Wert
-' True: Verbindung nach Öffnen des Recordset kappen ... verbindungsloses Recordset
-' ADODB.Recordset
-'
-'**/
+'
+' Optimizes ADODB.Recordset.Open method
+'
+' Parameters:
+' Source - Data source (e.g. SQL statement)
+' CursorType - ADODB.CursorTypeEnum value
+' LockType - ADODB.LockTypeEnum value
+' CursorLocation - ADODB.CursorLocationEnum value
+' DisconnectedRecordset - True: disconnect connection from recordset after opening
+'
+' Returns:
+' ADODB.Recordset
+'
'---------------------------------------------------------------------------------------
Public Function OpenRecordset(ByVal Source As String, _
Optional ByVal CursorType As ADODB.CursorTypeEnum = ADODB.CursorTypeEnum.adOpenForwardOnly, _
Optional ByVal LockType As ADODB.LockTypeEnum = ADODB.LockTypeEnum.adLockReadOnly, _
Optional ByVal CursorLocation As ADODB.CursorLocationEnum = -1, _
Optional ByVal DisconnectedRecordset As Boolean = False) As ADODB.Recordset
-' gibt geöffnetes ADO-Recordset zurück
-' Source = SQL-Anweisung
Dim rst As ADODB.Recordset
@@ -342,68 +364,62 @@ End Function
'---------------------------------------------------------------------------------------
' Function: OpenRecordsetCommandParam
'---------------------------------------------------------------------------------------
-'/**
-'
-' Recocordset mittels ADODB.Command öffnen
-'
-' ADODB.CommandText-Wert
-' ADODB.CommandType-Wert
-' 2-dimensionales Parameter-Array (Array(n,1) ... x(n,0) = Parametername, x(n,0) = Parameterwert) ... abwechselnd Paramtername und Parameterwert einstellen
-' ADODB.Recordset
-' Mit dieser Variante kann sehr einfach SQL-Injection vermieden werden, da die Parameter nicht direkt in der SQL-Anweisung eingebaut sind und somit ein Parameterwert (der z. B. von einer Benutzereingabe stammt) keine SQL-Anweisung einschleusen kann.
-'**/
+'
+' Open recordset using ADODB.Command
+'
+' Parameters:
+' CmdText - ADODB.CommandText value
+' CmdType - ADODB.CommandType value
+' CmdParamDefs - 2-dimensional parameter array (Array(n,1) ... x(n,0) = parameter name, x(n,1) = parameter value)
+' RecordsAffected - ByRef parameter to return the number of records affected by the Execute statement.
+' Options - additional options of the ADODB.Command.Execute method
+' DisconnectedRecordset - True: disconnect connection from recordset after opening
+'
+' Returns:
+' ADODB.Recordset
+'
+' Remarks:
+' With this variant, SQL injection can be avoided very easily,
+' since the parameters are not built directly into the SQL statement
+' and thus a parameter value (which comes from a user input, for example) cannot inject an SQL statement.
+'
'---------------------------------------------------------------------------------------
Public Function OpenRecordsetCommandParam(ByVal CmdText As String, _
ByVal CmdType As ADODB.CommandTypeEnum, _
- Optional ByVal commandParamDefs As Variant) As ADODB.Recordset
-'gibt geöffnetes ADO-Recordset zurück
-
- Dim cmd As ADODB.Command
-
- Dim ParamDefsArraySize As Long
- Dim i As Long
- Dim strParamName As String
-
- Set cmd = New ADODB.Command
-
- With cmd
-
- Set .ActiveConnection = Me.CurrentConnection
- .CommandText = CmdText
- .CommandType = CmdType
-
- If Not IsMissing(commandParamDefs) Then
- ParamDefsArraySize = UBound(commandParamDefs, 1)
- For i = 0 To ParamDefsArraySize
- strParamName = Nz(commandParamDefs(i, 0), vbNullString)
- If Len(strParamName) > 0 Then
- .Parameters(commandParamDefs(i, 0)).Value = commandParamDefs(i, 1)
- End If
- Next i
- End If
-
- Set OpenRecordsetCommandParam = .Execute()
-
- End With
-
- Set cmd = Nothing
+ Optional ByVal CmdParamDefs As Variant, _
+ Optional ByRef RecordsAffected As Long, _
+ Optional ByVal Options As Long = -1, _
+ Optional ByVal DisconnectedRecordset As Boolean = False) As ADODB.Recordset
+ Dim rst As ADODB.Recordset
+
+ Set rst = ExecuteCommand(CmdText, CmdType, CmdParamDefs, RecordsAffected, Options)
+ If DisconnectedRecordset Then
+ Set rst.ActiveConnection = Nothing
+ End If
+
+ Set OpenRecordsetCommandParam = rst
End Function
'---------------------------------------------------------------------------------------
' Function: LookupSQL
'---------------------------------------------------------------------------------------
-'/**
-'
-' Lookup-Recordset-Ersatzfunktion für Übergabe einer vollständigen SQL-Anweisung
-'
-' SQL-Anweisung
-' Feldauswahl, falls nicht das erste Feld des Recordsets zurückgeliefert werden soll. Die Index-Übergabe erfolgt analaog ADODB.Recordset.Fields(index)
-' Rückgabewert bei fehlendem Datensatz oder NULL-Feldwert (Standard: Null
-' Variant (NULL, falls SQL-Anweisung keinen Datensatz liefert.)
-' Die SQL-Anweisung ist im SQL-Dialekt des betroffenen DBMS zu schreiben.
-'**/
+'
+' Lookup ADODB.Recordset replacement function for DLookup (passing a SQL statement)
+'
+' Parameters:
+' SqlText - SQL statement
+' Index - Field selection if the first field of the recordset is not to be returned.
+' The index is passed in the same way as ADODB.Recordset.Fields(index).
+' ValueIfNull - Return value if record is missing or data field value is Null (default: Null).
+'
+' Returns:
+' Variant - Null, if SQL statement does not return a record.
+'
+' Remarks:
+' The SQL statement must be written in the SQL dialect of the DBMS concerned.
+'
'---------------------------------------------------------------------------------------
Public Function LookupSql(ByVal SqlText As String, _
Optional ByVal Index As Variant = 0&, _
@@ -440,16 +456,18 @@ End Function
'---------------------------------------------------------------------------------------
' Function: Lookup
'---------------------------------------------------------------------------------------
-'/**
-'
-' Lookup-Recordset-Ersatzfunktion
-'
-' Feldname oder berechneter Ausdruck (Select-Teil)
-' Tabelle, Abfrage oder SQL-Ausdruck für Sub-Abfrage (FROM-Teil)
-' Filter (WHERE-Teil)
-' Variant
-'
-'**/
+'
+' ADODB.Recordset replacement function for DLookup
+'
+' Parameters:
+' Expr - Field name or calculated expression (select part)
+' Domain - Table, query or SQL expression for sub-query (FROM part)
+' Criteria - (Optional) Criteria string (WHERE part)
+' ValueIfNull - Return value if record is missing or data field value is Null (default: Null).
+'
+' Returns:
+' Variant
+'
'---------------------------------------------------------------------------------------
Public Function Lookup(ByVal Expr As String, ByVal Domain As String, _
Optional ByVal Criteria As Variant, _
@@ -468,18 +486,19 @@ Public Function Lookup(ByVal Expr As String, ByVal Domain As String, _
End Function
'---------------------------------------------------------------------------------------
-' Function: DCount
+' Function: Count
'---------------------------------------------------------------------------------------
-'/**
-'
-' DCount-Recordset-Ersatzfunktion
-'
-' Feldname oder berechneter Ausdruck (Select-Teil)
-' Tabelle, Abfrage oder SQL-Ausdruck für Sub-Abfrage (FROM-Teil)
-' Filter (WHERE-Teil)
-' Long
-'
-'**/
+'
+' ADODB.Recordset replacement function for DCount
+'
+' Parameters:
+' Expr - Field name or calculated expression (select part)
+' Domain - Table, query or SQL expression for sub-query (FROM part)
+' Criteria - (Optional) Criteria string (WHERE part)
+'
+' Returns:
+' Long
+'
'---------------------------------------------------------------------------------------
Public Function Count(ByVal Expr As String, ByVal Domain As String, Optional ByVal Criteria As Variant) As Long
Count = Nz(Me.Lookup("Count(" & Expr & ")", Domain, Criteria), 0)
@@ -488,16 +507,17 @@ End Function
'---------------------------------------------------------------------------------------
' Function: Max
'---------------------------------------------------------------------------------------
-'/**
-'
-' DMax-Recordset-Ersatzfunktion
-'
-' Feldname oder berechneter Ausdruck (Select-Teil)
-' Tabelle, Abfrage oder SQL-Ausdruck für Sub-Abfrage (FROM-Teil)
-' Filter (WHERE-Teil)
-' Variant
-'
-'**/
+'
+' ADODB.Recordset replacement function for DMax
+'
+' Parameters:
+' Expr - Field name or calculated expression (select part)
+' Domain - Table, query or SQL expression for sub-query (FROM part)
+' Criteria - (Optional) Criteria string (WHERE part)
+'
+' Returns:
+' Variant
+'
'---------------------------------------------------------------------------------------
Public Function Max(ByVal Expr As String, ByVal Domain As String, Optional ByVal Criteria As Variant) As Variant
Max = Me.Lookup("Max(" & Expr & ")", Domain, Criteria)
@@ -506,16 +526,17 @@ End Function
'---------------------------------------------------------------------------------------
' Function: Min
'---------------------------------------------------------------------------------------
-'/**
-'
-' DMin-Recordset-Ersatzfunktion
-'
-' Feldname oder berechneter Ausdruck (Select-Teil)
-' Tabelle, Abfrage oder SQL-Ausdruck für Sub-Abfrage (FROM-Teil)
-' Filter (WHERE-Teil)
-' Variant
-'
-'**/
+'
+' ADODB.Recordset replacement function for DMin
+'
+' Parameters:
+' Expr - Field name or calculated expression (select part)
+' Domain - Table, query or SQL expression for sub-query (FROM part)
+' Criteria - (Optional) Criteria string (WHERE part)
+'
+' Returns:
+' Variant
+'
'---------------------------------------------------------------------------------------
Public Function Min(ByVal Expr As String, ByVal Domain As String, Optional ByVal Criteria As Variant) As Variant
Min = Me.Lookup("Min(" & Expr & ")", Domain, Criteria)
@@ -524,32 +545,64 @@ End Function
'---------------------------------------------------------------------------------------
' Function: Sum
'---------------------------------------------------------------------------------------
-'/**
-'
-' DSum-Recordset-Ersatzfunktion
-'
-' Feldname oder berechneter Ausdruck (Select-Teil)
-' Tabelle, Abfrage oder SQL-Ausdruck für Sub-Abfrage (FROM-Teil)
-' Filter (WHERE-Teil)
-' Variant
-'
-'**/
+'
+' ADODB.Recordset replacement function for DSum
+'
+' Parameters:
+' Expr - Field name or calculated expression (select part)
+' Domain - Table, query or SQL expression for sub-query (FROM part)
+' Criteria - (Optional) Criteria string (WHERE part)
+'
+' Returns:
+' Variant
+'
'---------------------------------------------------------------------------------------
Public Function Sum(ByVal Expr As String, ByVal Domain As String, Optional ByVal Criteria As Variant) As Variant
Sum = Me.Lookup("Sum(" & Expr & ")", Domain, Criteria)
End Function
+'---------------------------------------------------------------------------------------
+' Function: Exists
+'---------------------------------------------------------------------------------------
+'
+' Check if record exists
+'
+' Parameters:
+' Domain - data source (FROM part)
+' Criteria - (Optional) Criteria string (WHERE part)
+'
+' Returns:
+' Boolean
+'
+'---------------------------------------------------------------------------------------
+Public Function Exists(ByVal Domain As String, _
+ Optional ByVal Criteria As String = vbNullString) As Boolean
+
+ Dim strSQL As String
+
+ strSQL = "SELECT 1 FROM " & Domain
+ If Len(Criteria) > 0 Then
+ strSQL = strSQL & " WHERE " & Criteria
+ End If
+ Exists = (LookupSql(strSQL, , 0) = 1)
+
+End Function
+
'---------------------------------------------------------------------------------------
' Function: InsertIdentityReturn
'---------------------------------------------------------------------------------------
-'/**
-'
-' Insert-SQL-Anweisung ausführen und letzten Identity-Wert (Autowert) zurückgeben
-'
-' Insert-SQL-Anweisung (INSERT ...)
-' Identity-Wert oder NULL falls kein Datensatz angefügt wurde
-' Funktioniert für Jet erst ab Jet 4.0 (Access 2000), IdentityTable ist nur für MSSQL anwendbar, unter MySQL gibt es die Funktion IDENT_CURRENT nicht.
-'**/
+'
+' Execute insert SQL statement and return last identity value (auto value)
+'
+' Parameters:
+' InsertSQL - Insert SQL statement
+'
+' Returns:
+' Identity value or NULL if no record was appended
+'
+' Remarks:
+' Works for Jet only from Jet 4.0 (Access 2000), IdentityTable is only applicable for MSSQL, under MySQL the IDENT_CURRENT function does not exist.
+'
'---------------------------------------------------------------------------------------
Public Function InsertIdentityReturn(ByVal InsertSql As String, Optional ByVal IdentityTable As String = vbNullString) As Variant
@@ -613,7 +666,24 @@ HandleErr:
End Function
-Public Function InsertValuesIdentityReturn(ByVal sSource As String, ParamArray InsertFields() As Variant) As Variant
+'---------------------------------------------------------------------------------------
+' Function: InsertValuesIdentityReturn
+'---------------------------------------------------------------------------------------
+'
+' Create and execute insert SQL statement and return last identity value (auto value)
+'
+' Parameters:
+' Source - Table order query name
+' InsertFields - ParamArray: "Field1", Value1, "Field2", Value2, ....
+'
+' Returns:
+' Identity value or NULL if no record was appended
+'
+' Remarks:
+' Works for Jet only from Jet 4.0 (Access 2000), IdentityTable is only applicable for MSSQL, under MySQL the IDENT_CURRENT function does not exist.
+'
+'---------------------------------------------------------------------------------------
+Public Function InsertValuesIdentityReturn(ByVal Source As String, ParamArray InsertFields() As Variant) As Variant
Dim strInsert As String
Dim strValues As String
@@ -623,25 +693,27 @@ Public Function InsertValuesIdentityReturn(ByVal sSource As String, ParamArray I
strInsert = strInsert & ", " & InsertFields(i)
strValues = strValues & ", " & InsertFields(i + 1)
Next i
- strInsert = "INSERT INTO " & sSource & " (" & Mid(strInsert, 3) & ") VALUES (" & Mid(strValues, 3) & ")"
+ strInsert = "INSERT INTO " & Source & " (" & Mid(strInsert, 3) & ") VALUES (" & Mid(strValues, 3) & ")"
- InsertValuesIdentityReturn = InsertIdentityReturn(strInsert, sSource)
-
-End Function
-
-Public Function Exists(ByVal SourceName As String, _
- Optional ByVal Criteria As String = vbNullString) As Boolean
-
- Dim strSQL As String
-
- strSQL = "SELECT 1 FROM " & SourceName
- If Len(Criteria) > 0 Then
- strSQL = strSQL & " WHERE " & Criteria
- End If
- Exists = (LookupSql(strSQL, , 0) = 1)
+ InsertValuesIdentityReturn = InsertIdentityReturn(strInsert, Source)
End Function
+'---------------------------------------------------------------------------------------
+' Function: ValueList
+'---------------------------------------------------------------------------------------
+'
+' Generate concat string from recordset result
+'
+' Parameters:
+' SqlSource - Select statement
+' ListConcatString - (optional) Character to join results, Default = ", "
+' ValueIfNull - (optional) Value if no results, Default = Null
+'
+' Returns:
+' Variant - result exists: string, no result exists: ValueIfNull
+'
+'---------------------------------------------------------------------------------------
Public Function ValueList(ByVal SqlSource As String, Optional ByVal ListConcatString As String = ", ", Optional ValueIfNull As Variant = Null) As Variant
Dim ListString As String
@@ -662,19 +734,26 @@ Public Function ValueList(ByVal SqlSource As String, Optional ByVal ListConcatSt
End Function
+'---------------------------------------------------------------------------------------
+' Function: LookupSqlValueCollection
+'---------------------------------------------------------------------------------------
+'
+' Generate collection from recordset result
+'
+' Parameters:
+' SqlSource - Select statement
+' ValueIfNull - (optional) Value if no results, Default = Null
+'
+' Returns:
+' Collection
+'
+'---------------------------------------------------------------------------------------
Public Function LookupSqlValueCollection(ByVal SqlSource As String, Optional ByVal ValueIfNull As Variant = Null) As Collection
-' Dim lngWherePos As Long
Dim Results As Collection
Dim rst As ADODB.Recordset
Dim fld As ADODB.Field
-' lngWherePos = InStr(1, SqlSource, "WHERE", vbTextCompare)
-' If lngWherePos > 0 Then
-' SqlSource = Left$(SqlSource, lngWherePos + 5) & Replace(SqlSource, "*", "%", lngWherePos + 6, , vbBinaryCompare)
-' SqlSource = Replace(SqlSource, "Count(%)", "Count(*)")
-' End If
-
Set rst = OpenRecordset(SqlSource, adOpenKeyset, adLockOptimistic, adUseClient, True)
Set Results = New Collection
diff --git a/source/codelib/data/dao/DaoHandler.cls b/source/codelib/data/dao/DaoHandler.cls
index 7344cb0..1bc6d08 100644
--- a/source/codelib/data/dao/DaoHandler.cls
+++ b/source/codelib/data/dao/DaoHandler.cls
@@ -8,16 +8,16 @@ Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'---------------------------------------------------------------------------------------
-' Class: DaoHandler
+' Class: data.dao.DaoHandler
'---------------------------------------------------------------------------------------
-'/**
-' \author Josef Poetzl
-'
-' DAO-Zugriffsmethoden
-'
-'
-'\ingroup data_dao
-'**/
+'
+' DAO data connection methods
+'
+' Author:
+' Josef Poetzl
+'
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
'
' data/dao/DaoHandler.cls
@@ -36,26 +36,37 @@ Option Explicit
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByRef Dest As Any, ByRef Source As Any, ByVal Bytes As Long)
#End If
-'DAO-Database
+'DAO Database
Private m_DaoDb As DAO.Database
-'Standardwerte für optionale DAO-Enum-Paramter z. B. in OpenRecordset
-' (falls diese nicht gesetzt sind, gilt DAO-Standard)
+'Default values for optional DAO enum parameters, e.g. in OpenRecordset.
+' (if these are not set, DAO standard applies)
Private m_RecordsetTypeEnumDefault As DAO.RecordsetTypeEnum
Private m_RecordsetOptionEnumDefault As DAO.RecordsetOptionEnum
Private m_LockTypeEnumDefault As DAO.LockTypeEnum
-'Error-Events für mögliche Fehlerbehandlung über die FE-Anwendung
-'/**
-'
-' Ereignis für fehlende CurrentDb-Referenz
-'
-' Meldung über Ursache der Ereignisauslösung. (Wird noch nicht genutzt)
-' DAO.Database-Referenz, die für CurrentDb verwendet werden soll
-' über den ByRef-Parameter NewCurrentDbRef kann die passende DAO.Database-Referenz weitergegeben werden.
-'**/
+'#############################################################
+' Group: Events
+
+'---------------------------------------------------------------------------------------
+' Event: ErrorMissingCurrentDb
+'---------------------------------------------------------------------------------------
+' Event for missing CurrentDb reference
+'
+' Parameters:
+' Msg - Message about the cause of the event triggering. (Not yet used)
+' NewCurrentDbRef - DAO.Database reference to be used for CurrentDb
+'
+' Remarks:
+' The required DAO.Database reference can be passed on via the ByRef parameter NewCurrentDbRef.
+'
+'---------------------------------------------------------------------------------------
Public Event ErrorMissingCurrentDb(ByVal Msg As String, ByRef NewCurrentDbRef As DAO.Database)
+
+'#############################################################
+' Group: Class control
+
'
' Init / Terminate
' ----------------
@@ -68,6 +79,13 @@ Private Sub Class_Terminate()
Dispose
End Sub
+'---------------------------------------------------------------------------------------
+' Sub: Dispose
+'---------------------------------------------------------------------------------------
+'
+' Remove object references
+'
+'---------------------------------------------------------------------------------------
Public Sub Dispose()
Set m_DaoDb = Nothing
m_RecordsetTypeEnumDefault = 0
@@ -78,15 +96,17 @@ End Sub
'---------------------------------------------------------------------------------------
' Sub: InitRecordsetEnumDefaultValues
'---------------------------------------------------------------------------------------
-'/**
-'
-' Standardwerte für Recordset-Enums einstellen, welche verwendet werden, wenn Parameter nicht gesetzt werden können (z. B. in OpenRecordsetParamSQL2)
-'
-' Standardwert aus DAO.RecordsetTypeEnum
-' Standardwert aus DAO.RecordsetOptionEnum
-' Standardwert aus DAO.LockTypeEnum
-' Wenn 0 eingestellt wird, kommt Standard von DAO zum Einsatz (0-Parameter werden als "IsMissing"-Variant-Wert an DAO weitergeben)
-'**/
+'
+' Set default values for recordset enums, which are used when parameters cannot be set.
+'
+' Parameters:
+' RecordsetType - DAO.RecordsetTypeEnum
+' Options - DAO.RecordsetOptionEnum
+' LockEdit - DAO.LockTypeEnum
+'
+' Remarks:
+' If 0 is set, standard of DAO is used (0 parameters are passed on to DAO as "IsMissing" variant value).
+'
'---------------------------------------------------------------------------------------
Public Sub InitRecordsetEnumDefaultValues( _
Optional ByRef RecordsetType As DAO.RecordsetTypeEnum, _
@@ -99,33 +119,36 @@ Public Sub InitRecordsetEnumDefaultValues( _
End Sub
+'#############################################################
+' Group: Data Connection
+
'---------------------------------------------------------------------------------------
' Property: CurrentDb
'---------------------------------------------------------------------------------------
-'/**
-'
-' CurrentDbC-Variante
-'
-' DAO.Database
-'
-' CurrentDbC-Variante, die zum Unterschied zur Original-Version von Michael Kaplan
-' die DAO-Database-Referenz nicht automatisch auf Access.Application.CurrentDb setzt,
-' sondern über ein Ereignis anfordert, falls noch keine Referenz vorhanden ist.
-' Dadurch kann über die Hauptanwendung eine belibige Database-Referenz übergeben werden.
-' (z. B. falls eine Temp-Datenbank als CurrentDb dienen soll)
-'**/
+'
+' CurrentDbC variant
+'
+' Returns:
+' DAO.Database
+'
+' Remarks:
+' CurrentDbC variant which, unlike the original version by Michael Kaplan,
+' does not automatically set the DAO database reference to Access.Application.CurrentDb,
+' but requests it via an event if no reference exists yet.
+' This allows any database reference to be passed via the main application.
+' (e.g. if a temp database is to serve as CurrentDb).
+'
'---------------------------------------------------------------------------------------
Public Property Get CurrentDb() As DAO.Database
If (m_DaoDb Is Nothing) Then
'Error-Event auslösen und hoffen, dass neue Referenz geliefert wird
RaiseEvent ErrorMissingCurrentDb("DaoHandler.CurrentDb: unavailable CurrentDb-Database", m_DaoDb)
If (m_DaoDb Is Nothing) Then
- 'CurrentDb der Anwendung verwenden, falls DaoHandler "selbstinstanzierend" (VB_PredeclaredId = True) verwendet wird
- ' Achtung! ... diese Prüfung hat eventuell den Nachteil,
- ' dass ab hier VB_PredeclaredId wirksam wird,
- ' obwohl es möglicherweise nicht benötigt wird.
- If Me Is DaoHandler Then 'trifft nur zu, wenn Instanz identisch mit der VB_PredeclaredId-Instanz ist
- ' Jede andere Instanz von DaoHandler hat andere Speicheradresse (ObjPtr(Me) <> ObjPtr(DaoHandler)).
+ 'Use CurrentDb of the application if DaoHandler "self-instantiating" (VB_PredeclaredId = True) is used.
+ 'Attention! ... this check may have the disadvantage that from here on VB_PredeclaredId takes effect,
+ ' although it may not be needed.
+ If Me Is DaoHandler Then 'applies only if instance is identical to VB_PredeclaredId instance
+ ' Every other instance of DaoHandler has different memory address (ObjPtr(Me) <> ObjPtr(DaoHandler)).
Set Me.CurrentDb = Application.CurrentDb
End If
End If
@@ -133,37 +156,30 @@ Public Property Get CurrentDb() As DAO.Database
Set CurrentDb = m_DaoDb
End Property
+Public Property Set CurrentDb(ByRef NewCurrentDb As DAO.Database)
+ Set m_DaoDb = NewCurrentDb
+End Property
+
Friend Property Get CurrentDbReferenceOnly() As DAO.Database
Set CurrentDbReferenceOnly = m_DaoDb
End Property
-'---------------------------------------------------------------------------------------
-' Property: CurrentDb
-'---------------------------------------------------------------------------------------
-'/**
-'
-' Übergabe der DAO-Database-Referenz
-'
-' Database-Referenz, die als "CurrentDb" verwendet werden soll
-' DAO.Database
-'
-'**/
-'---------------------------------------------------------------------------------------
-Public Property Set CurrentDb(ByRef NewCurrentDb As DAO.Database)
- Set m_DaoDb = NewCurrentDb
-End Property
+'#############################################################
+' Group: Data Operations
'---------------------------------------------------------------------------------------
' Function: Execute
'---------------------------------------------------------------------------------------
-'/**
-'
-' SQL-Anweisung ausführen
-'
-' SQL-Anweisung
-'
-' Long (Anzahl der betroffenen Datensätze)
-'**/
+'
+' Execute SQL statement
+'
+' Parameters:
+' CommandText - SQL statement (String)
+' Options - DAO.RecordsetOptionEnum
+'
+' Returns:
+' RecordsAffected (Long)
+'
'---------------------------------------------------------------------------------------
Public Function Execute(ByVal Query As String, _
Optional ByVal Options As DAO.RecordsetOptionEnum) As Long
@@ -179,21 +195,16 @@ End Function
'---------------------------------------------------------------------------------------
' Function: ExecuteParamSQL
'---------------------------------------------------------------------------------------
-'/**
-'
-' Sql-Anweisung mit Parametern ausführen
-'
-' SQL-Anweisung
-' Parmeterwerte in passender Reihenfolge
-'
-' Werte in passender Reihenfolge als ParamArray oder als Array
-' oder
-' 2-dimensionales Parameter-Array (Array(n,1) ... x(n,0) = Parametername, x(n,1) = Parameterwert) ... erzeugbar mit GetParamDefArray oder GetNamedParamDefArray
-'
-' Long (Anzahl der betroffenen Datensätze)
-'
-'
-'**/
+'
+' Execute SQL statement with parameters
+'
+' Parameters:
+' SqlText - SQL statement
+' QueryParams - Values in suitable order as ParamArray or as array or 2-dimensional parameter array (Array(n,1) ... x(n,0) = parameter name, x(n,1) = parameter value) ... generateable with GetParamDefArray or GetNamedParamDefArray
+'
+' Returns:
+' RecordsAffected (Long)
+'
'---------------------------------------------------------------------------------------
Public Function ExecuteParamSql(ByVal SqlText As String, _
ParamArray QueryParams() As Variant) As Long
@@ -230,20 +241,17 @@ End Function
'---------------------------------------------------------------------------------------
' Function: ExecuteQueryDefByName
'---------------------------------------------------------------------------------------
-'/**
-'
-' Gespeicherte Abfrage (optional mit Parametern) ausführen
-'
-' Name der gespeicherten Abfrage (QueryDef)
-'
-' Werte in passender Reihenfolge als ParamArray oder als Array
-' oder
-' 2-dimensionales Parameter-Array (Array(n,1) ... x(n,0) = Parametername, x(n,1) = Parameterwert) ... erzeugbar mit GetParamDefArray oder GetNamedParamDefArray
-'
-' Long (Anzahl der betroffenen Datensätze)
-'
-'
-'**/
+'
+' Execute saved query (optionally with parameters)
+'
+' Parameters:
+' QueryName - QueryDef name
+' QueryParams - Values in suitable order as ParamArray or as array
+' or 2-dimensional parameter array (Array(n,1) ... x(n,0) = parameter name, x(n,1) = parameter value) ... generateable with GetParamDefArray or GetNamedParamDefArray
+'
+' Returns:
+' RecordsAffected (Long)
+'
'---------------------------------------------------------------------------------------
Public Function ExecuteQueryDefByName(ByVal QueryName As String, _
ParamArray QueryParams() As Variant) As Long
@@ -280,20 +288,17 @@ End Function
'---------------------------------------------------------------------------------------
' Function: ExecuteQueryDef
'---------------------------------------------------------------------------------------
-'/**
-'
-' QueryDef-Objekt mit Parameterwerten befüllen und anschließend ausführen
-'
-' QueryDef-Referenz
-'
-' Werte in passender Reihenfolge als ParamArray oder als Array
-' oder
-' 2-dimensionales Parameter-Array (Array(n,1) ... x(n,0) = Parametername, x(n,1) = Parameterwert) ... erzeugbar mit GetParamDefArray oder GetNamedParamDefArray
-'
-' Long (Anzahl der betroffenen Datensätze)
-'
-'
-'**/
+'
+' Fill QueryDef object with parameter values and then execute it
+'
+' Parameters:
+' QdfRef - QueryDef reference
+' QueryParams - Values in suitable order as ParamArray or as array
+' or 2-dimensional parameter array (Array(n,1) ... x(n,0) = parameter name, x(n,1) = parameter value) ... generateable with GetParamDefArray or GetNamedParamDefArray
+'
+' Returns:
+' RecordsAffected (Long)
+'
'---------------------------------------------------------------------------------------
Public Function ExecuteQueryDef(ByVal QdfRef As DAO.QueryDef, _
ParamArray QueryParams() As Variant) As Long
@@ -333,20 +338,17 @@ End Sub
'---------------------------------------------------------------------------------------
' Function: ParamQueryDefByName
'---------------------------------------------------------------------------------------
-'/**
-'
-' Gespeicherte Abfrage als QueryDef-Objekt ink. übergebenen Parameterwerten öffnen
-'
-' QueryDef-Name
-'
-' Werte in passender Reihenfolge als ParamArray oder als Array
-' oder
-' 2-dimensionales Parameter-Array (Array(n,1) ... x(n,0) = Parametername, x(n,1) = Parameterwert) ... erzeugbar mit GetParamDefArray oder GetNamedParamDefArray
-'
-' DAO.QueryDef
-'
-'
-'**/
+'
+' Open saved query as QueryDef object incl. passed parameter values
+'
+' Parameters:
+' QueryName - name of query with parameters
+' QueryParams - Values in suitable order as ParamArray or as array
+' or 2-dimensional parameter array (Array(n,1) ... x(n,0) = parameter name, x(n,1) = parameter value) ... generateable with GetParamDefArray or GetNamedParamDefArray
+'
+' Returns:
+' DAO.QueryDef
+'
'---------------------------------------------------------------------------------------
Public Function ParamQueryDefByName(ByVal QueryName As String, ParamArray QueryParams() As Variant) As DAO.QueryDef
@@ -366,20 +368,17 @@ End Function
'---------------------------------------------------------------------------------------
' Function: ParamQueryDefSql
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Temporäres QueryDef-Objekt ink. übergebenen Parameterwerten öffnen
-'
-' SQL-Anweisung für das temporäre QueryDef-Objekt
-'
-' Werte in passender Reihenfolge als ParamArray oder als Array
-' oder
-' 2-dimensionales Parameter-Array (Array(n,1) ... x(n,0) = Parametername, x(n,1) = Parameterwert) ... erzeugbar mit GetParamDefArray oder GetNamedParamDefArray
-'
-' DAO.QueryDef
-'
-'
-'**/
+'
+' Parameters:
+' ParamSqlText - SQL statement for the temporary QueryDef object
+' QueryParams - Values in suitable order as ParamArray or as array
+' or 2-dimensional parameter array (Array(n,1) ... x(n,0) = parameter name, x(n,1) = parameter value) ... generateable with GetParamDefArray or GetNamedParamDefArray
+'
+' Returns:
+' DAO.QueryDef
+'
'---------------------------------------------------------------------------------------
Public Function ParamQueryDefSql(ByVal ParamSqlText As String, ParamArray QueryParams() As Variant) As DAO.QueryDef
@@ -396,21 +395,21 @@ Public Function ParamQueryDefSql(ByVal ParamSqlText As String, ParamArray QueryP
End Function
-
'---------------------------------------------------------------------------------------
' Function: OpenRecordset
'---------------------------------------------------------------------------------------
-'/**
-'
-' Recordset öffnen
-'
-' SQL-Anweisung oder Tabllen- bzw. Abfragename
-' DAO.RecordsetTypeEnum (Standard: dbOpenDynaset)
-' DAO.RecordsetOptionEnum (Standard: dbSeeChanges)
-' DAO.LockTypeEnum (Standard: dbOptimistic)
-' DAO.Recordset
-'
-'**/
+'
+' Open DAO.Recordset
+'
+' Parameters:
+' Source - SQL statement or table or query name
+' RecordsetType - DAO.RecordsetTypeEnum (Standard: dbOpenDynaset)
+' RecordsetOptions - DAO.RecordsetOptionEnum (Standard: dbSeeChanges)
+' LockEdit - DAO.LockTypeEnum (Standard: dbOptimistic)
+'
+' Returns:
+' DAO.Recordset
+'
'---------------------------------------------------------------------------------------
Public Function OpenRecordset(ByVal Source As String, _
Optional ByVal RecordsetType As DAO.RecordsetTypeEnum = dbOpenDynaset, _
@@ -421,7 +420,7 @@ Public Function OpenRecordset(ByVal Source As String, _
RecordsetOptions = RecordsetOptions + dbSeeChanges
End If
- ' Replace0WithIsMissing ... damit IsMissing für Variant-Datentyp an Original-DAO-Openrecordset wirkt
+ ' Replace0WithIsMissing ... so that IsMissing for Variant data type works on original DAO openrecordset
Set OpenRecordset = Me.CurrentDb.OpenRecordset(Source, _
Replace0WithIsMissing(RecordsetType), _
Replace0WithIsMissing(RecordsetOptions), _
@@ -444,22 +443,20 @@ End Function
'---------------------------------------------------------------------------------------
' Function: OpenRecordsetParamSQL
'---------------------------------------------------------------------------------------
-'/**
-'
-' Parameter-SQL-Anweisung öffnen (verwendet temporäres QueryDef)
-'
-' SQL-Anweisung mit Parameter (Parameters-Deklaration)
-' DAO.RecordsetTypeEnum (Standard: dbOpenDynaset)
-' DAO.RecordsetOptionEnum (Standard: dbSeeChanges)
-' DAO.LockTypeEnum (Standard: dbOptimistic)
-'
-' Werte in passender Reihenfolge als ParamArray oder als Array
-' oder
-' 2-dimensionales Parameter-Array (Array(n,1) ... x(n,0) = Parametername, x(n,1) = Parameterwert) ... erzeugbar mit GetParamDefArray oder GetNamedParamDefArray
-'
-' DAO.Recordset
-'
-'**/
+'
+' Open parameter SQL statement (uses temporary QueryDef)
+'
+' Parameters:
+' ParamSqlText - SQL statement with parameters (parameter declaration)
+' RecordsetType - DAO.RecordsetTypeEnum (Standard: dbOpenDynaset)
+' RecordsetOptions - DAO.RecordsetOptionEnum (Standard: dbSeeChanges)
+' LockEdit - DAO.LockTypeEnum (Standard: dbOptimistic)
+' QueryParams - Values in suitable order as ParamArray or as array
+' or 2-dimensional parameter array (Array(n,1) ... x(n,0) = parameter name, x(n,1) = parameter value) ... generateable with GetParamDefArray or GetNamedParamDefArray
+'
+' Returns:
+' DAO.Recordset
+'
'---------------------------------------------------------------------------------------
Public Function OpenRecordsetParamSql(ByVal ParamSqlText As String, _
ByVal RecordsetType As DAO.RecordsetTypeEnum, _
@@ -495,21 +492,19 @@ HandleErr:
End Function
'---------------------------------------------------------------------------------------
-' Function: OpenRecordsetParamSQL2
+' Function: OpenRecordsetParamSql2
'---------------------------------------------------------------------------------------
-'/**
-'
-' Parameter-SQL-Anweisung öffnen (wie OpenRecordsetParamSQL, nur mit Standardwerten für RecordsetType, RecordsetOptions u. LockEdit)
-'
-' SQL-Anweisung mit Parameter (Parameters-Deklaration)
-'
-' Werte in passender Reihenfolge als ParamArray oder als Array
-' oder
-' 2-dimensionales Parameter-Array (Array(n,1) ... x(n,0) = Parametername, x(n,1) = Parameterwert) ... erzeugbar mit GetParamDefArray oder GetNamedParamDefArray
-'
-' DAO.Recordset
-'
-'**/
+'
+' Open parameter SQL statement (like OpenRecordsetParamSQL, but with default values for RecordsetType, RecordsetOptions and LockEdit)
+'
+' Parameters:
+' ParamSqlText - SQL statement with parameters (parameter declaration)
+' QueryParams - Values in suitable order as ParamArray or as array
+' or 2-dimensional parameter array (Array(n,1) ... x(n,0) = parameter name, x(n,1) = parameter value) ... generateable with GetParamDefArray or GetNamedParamDefArray'
+'
+' Returns:
+' DAO.Recordset
+'
'---------------------------------------------------------------------------------------
Public Function OpenRecordsetParamSql2(ByVal ParamSqlText As String, _
ParamArray QueryParams() As Variant) As DAO.Recordset
@@ -523,14 +518,15 @@ End Function
'---------------------------------------------------------------------------------------
' Function: GetParamDefArray
'---------------------------------------------------------------------------------------
-'/**
-'
-' Erezugt 2-dimensionalen Parameter-Array (z. B. für OpenRecordsetQueryDef)
-'
-' Parmeterwerte in passender Reihenfolge (ohne Index-Kennung!)
-' DAO.Recordset
-'
-'**/
+'
+' Creates 2-dimensional parameter array (e.g. for OpenRecordsetQueryDef)
+'
+' Parameters:
+' ParamValues - Parmeter values in matching order (without index identifier!)
+'
+' Returns:
+' Variant (Array)
+'
'---------------------------------------------------------------------------------------
Public Function GetParamDefArray(ParamArray ParamValues() As Variant) As Variant
@@ -639,14 +635,15 @@ End Function
'---------------------------------------------------------------------------------------
' Function: GetNamedParamDefArray
'---------------------------------------------------------------------------------------
-'/**
-'
-' Erzeugt 2-dimensionalen Parameter-Array (z. B. für OpenRecordsetQueryDef)
-'
-' Parameter-Paare: abwechselnd Parameter-Index und Parameter-Wert
-' DAO.Recordset
-'
-'**/
+'
+' Creates 2-dimensional parameter array (e.g. for OpenRecordsetQueryDef)
+'
+' Parameters:
+' ParamValues - Parameter pairs: alternating parameter index and parameter value
+'
+' Returns:
+' Variant (Array)
+'
'---------------------------------------------------------------------------------------
Public Function GetNamedParamDefArray(ParamArray ParamIndexAndValues() As Variant) As Variant
@@ -681,19 +678,20 @@ End Function
'---------------------------------------------------------------------------------------
' Function: OpenRecordsetQueryDefByName
'---------------------------------------------------------------------------------------
-'/**
-'
-' Recordset von gespeicherter Abfrage (optional mit Parametern) öffnen
-'
-' Name der gespeicherten Abfrage (QueryDef)
-' 2-dimensionales Parameter-Array (Array(n,1) ... x(n,0) = Parametername, x(n,1) = Parameterwert)
-' DAO.RecordsetTypeEnum (Standard: dbOpenDynaset)
-' DAO.RecordsetOptionEnum (Standard: dbSeeChanges)
-' DAO.LockTypeEnum (Standard: dbOptimistic)
-' DAO.Recordset
-'
-'
-'**/
+'
+' Open recordset from saved query (optionally with parameters)
+'
+' Parameters:
+' QueryName - Name of the saved query
+' QueryParams - Values in suitable order as ParamArray or as array
+' or 2-dimensional parameter array (Array(n,1) ... x(n,0) = parameter name, x(n,1) = parameter value) ... generateable with GetParamDefArray or GetNamedParamDefArray'
+' RecordsetType - DAO.RecordsetTypeEnum (Standard: dbOpenDynaset)
+' RecordsetOptions - DAO.RecordsetOptionEnum (Standard: dbSeeChanges)
+' LockEdit - DAO.LockTypeEnum (Standard: dbOptimistic)
+'
+' Returns:
+' DAO.Recordset
+'
'---------------------------------------------------------------------------------------
Public Function OpenRecordsetQueryDefByName(ByVal QueryName As String, _
Optional ByVal QueryParams As Variant, _
@@ -728,32 +726,33 @@ End Function
'---------------------------------------------------------------------------------------
' Function: OpenRecordsetQueryDef
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Recordset von gespeicherter Abfrage (optional mit Parametern) öffnen
-'
-' QueryDef-Referenz
-' 2-dimensionales Parameter-Array (Array(n,1) ... x(n,0) = Parametername, x(n,1) = Parameterwert)
-' DAO.RecordsetTypeEnum (Standard: dbOpenDynaset)
-' DAO.RecordsetOptionEnum (Standard: dbSeeChanges)
-' DAO.LockTypeEnum (Standard: dbOptimistic)
-' DAO.Recordset
-'
-'
-'**/
+'
+' Parameters:
+' QdfRef - QueryDef reference
+' QueryParams - Values in suitable order as ParamArray or as array
+' or 2-dimensional parameter array (Array(n,1) ... x(n,0) = parameter name, x(n,1) = parameter value) ... generateable with GetParamDefArray or GetNamedParamDefArray'
+' RecordsetType - DAO.RecordsetTypeEnum (Standard: dbOpenDynaset)
+' RecordsetOptions - DAO.RecordsetOptionEnum (Standard: dbSeeChanges)
+' LockEdit - DAO.LockTypeEnum (Standard: dbOptimistic)
+'
+' Returns:
+' DAO.Recordset
+'
'---------------------------------------------------------------------------------------
Public Function OpenRecordsetQueryDef(ByVal QdfRef As DAO.QueryDef, _
- Optional ByVal QdfParamDefs As Variant, _
+ Optional ByVal QueryParams As Variant, _
Optional ByVal RecordsetType As DAO.RecordsetTypeEnum, _
- Optional ByVal Options As DAO.RecordsetOptionEnum, _
+ Optional ByVal RecordsetOptions As DAO.RecordsetOptionEnum, _
Optional ByVal LockEdit As DAO.LockTypeEnum) As DAO.Recordset
- If Not IsMissing(QdfParamDefs) Then
- FillQueryDefParameters QdfRef, QdfParamDefs
+ If Not IsMissing(QueryParams) Then
+ FillQueryDefParameters QdfRef, QueryParams
End If
Set OpenRecordsetQueryDef = QdfRef.OpenRecordset(Replace0WithIsMissing(RecordsetType), _
- Replace0WithIsMissing(Options), _
+ Replace0WithIsMissing(RecordsetOptions), _
Replace0WithIsMissing(LockEdit))
End Function
@@ -761,16 +760,21 @@ End Function
'---------------------------------------------------------------------------------------
' Function: LookupSQL
'---------------------------------------------------------------------------------------
-'/**
-'
-' Lookup-Recordset-Ersatzfunktion für die Übergabe einer vollständigen SQL-Anweisung
-'
-' SQL-Anweisung
-' Feldauswahl, falls nicht das erste Feld des Recordsets zurückgegeben werden soll
-' Rückgabewert bei fehlendem Datensatz oder NULL-Feldwert (Standard: Null
-' Variant
-' Die SQL-Anweisung ist im Jet-SQL-Dialekt zu schreiben.
-'**/
+'
+' Lookup DAO.Recordset replacement function for DLookup (passing a SQL statement)
+'
+' Parameters:
+' SqlText - SQL statement
+' Index - Field selection if the first field of the recordset is not to be returned.
+' The index is passed in the same way as ADODB.Recordset.Fields(index).
+' ValueIfNull - Return value if record is missing or data field value is Null (default: Null).
+'
+' Returns:
+' Variant - Null, if SQL statement does not return a record.
+'
+' Remarks:
+' The SQL statement must be written in the Jet/ACE SQL dialect.
+'
'---------------------------------------------------------------------------------------
Public Function LookupSql(ByVal SqlText As String, _
Optional ByVal Index As Variant = 0&, _
@@ -807,16 +811,18 @@ End Function
'---------------------------------------------------------------------------------------
' Function: Lookup
'---------------------------------------------------------------------------------------
-'/**
-'
-' Lookup-Recordset-Ersatzfunktion
-'
-' Feldname oder berechneter Ausdruck (Select-Teil)
-' Tabelle, Abfrage oder SQL-Ausdruck für Sub-Abfrage (FROM-Teil)
-' Filter (WHERE-Teil)
-' Variant
-'
-'**/
+'
+' DAO.Recordset replacement function for DLookup
+'
+' Parameters:
+' Expr - Field name or calculated expression (select part)
+' Domain - Table, query or SQL expression for sub-query (FROM part)
+' Criteria - (Optional) Criteria string (WHERE part)
+' ValueIfNull - Return value if record is missing or data field value is Null (default: Null).
+'
+' Returns:
+' Variant
+'
'---------------------------------------------------------------------------------------
Public Function Lookup(ByVal Expr As String, ByVal Domain As String, _
Optional ByVal Criteria As Variant, _
@@ -837,16 +843,17 @@ End Function
'---------------------------------------------------------------------------------------
' Function: Count
'---------------------------------------------------------------------------------------
-'/**
-'
-' DCount-Recordset-Ersatzfunktion
-'
-' Feldname oder berechneter Ausdruck (Select-Teil)
-' Tabelle, Abfrage oder SQL-Ausdruck für Sub-Abfrage (FROM-Teil)
-' Filter (WHERE-Teil)
-' Long
-'
-'**/
+'
+' DAO.Recordset replacement function for DCount
+'
+' Parameters:
+' Expr - Field name or calculated expression (select part)
+' Domain - Table, query or SQL expression for sub-query (FROM part)
+' Criteria - (optional) Criteria string (WHERE part)
+'
+' Returns:
+' Long
+'
'---------------------------------------------------------------------------------------
Public Function Count(ByVal Expr As String, ByVal Domain As String, Optional ByVal Criteria As Variant) As Long
Count = Nz(Me.Lookup("Count(" & Expr & ")", Domain, Criteria), 0)
@@ -855,16 +862,17 @@ End Function
'---------------------------------------------------------------------------------------
' Function: Max
'---------------------------------------------------------------------------------------
-'/**
-'
-' DMax-Recordset-Ersatzfunktion
-'
-' Feldname oder berechneter Ausdruck (Select-Teil)
-' Tabelle, Abfrage oder SQL-Ausdruck für Sub-Abfrage (FROM-Teil)
-' Filter (WHERE-Teil)
-' Variant
-'
-'**/
+'
+' DAO.Recordset replacement function for DMax
+'
+' Parameters:
+' Expr - Field name or calculated expression (select part)
+' Domain - Table, query or SQL expression for sub-query (FROM part)
+' Criteria - (Optional) Criteria string (WHERE part)
+'
+' Returns:
+' Variant
+'
'---------------------------------------------------------------------------------------
Public Function Max(ByVal Expr As String, ByVal Domain As String, Optional ByVal Criteria As Variant) As Variant
Max = Me.Lookup("Max(" & Expr & ")", Domain, Criteria)
@@ -873,16 +881,17 @@ End Function
'---------------------------------------------------------------------------------------
' Function: Min
'---------------------------------------------------------------------------------------
-'/**
-'
-' DMin-Recordset-Ersatzfunktion
-'
-' Feldname oder berechneter Ausdruck (Select-Teil)
-' Tabelle, Abfrage oder SQL-Ausdruck für Sub-Abfrage (FROM-Teil)
-' Filter (WHERE-Teil)
-' Variant
-'
-'**/
+'
+' DAO.Recordset replacement function for DMin
+'
+' Parameters:
+' Expr - Field name or calculated expression (select part)
+' Domain - Table, query or SQL expression for sub-query (FROM part)
+' Criteria - (Optional) Criteria string (WHERE part)
+'
+' Returns:
+' Variant
+'
'---------------------------------------------------------------------------------------
Public Function Min(ByVal Expr As String, ByVal Domain As String, Optional ByVal Criteria As Variant) As Variant
Min = Me.Lookup("Min(" & Expr & ")", Domain, Criteria)
@@ -891,16 +900,17 @@ End Function
'---------------------------------------------------------------------------------------
' Function: Sum
'---------------------------------------------------------------------------------------
-'/**
-'
-' DSum-Recordset-Ersatzfunktion
-'
-' Feldname oder berechneter Ausdruck (Select-Teil)
-' Tabelle, Abfrage oder SQL-Ausdruck für Sub-Abfrage (FROM-Teil)
-' Filter (WHERE-Teil)
-' Variant
-'
-'**/
+'
+' DAO.Recordset replacement function for DSum
+'
+' Parameters:
+' Expr - Field name or calculated expression (select part)
+' Domain - Table, query or SQL expression for sub-query (FROM part)
+' Criteria - (Optional) Criteria string (WHERE part)
+'
+' Returns:
+' Variant
+'
'---------------------------------------------------------------------------------------
Public Function Sum(ByVal Expr As String, ByVal Domain As String, Optional ByVal Criteria As Variant) As Variant
Sum = Me.Lookup("Sum(" & Expr & ")", Domain, Criteria)
@@ -909,15 +919,16 @@ End Function
'---------------------------------------------------------------------------------------
' Function: Exists
'---------------------------------------------------------------------------------------
-'/**
-'
-' DSum-Recordset-Ersatzfunktion
-'
-' Tabelle, Abfrage oder SQL-Ausdruck für Sub-Abfrage (FROM-Teil)
-' Filter (WHERE-Teil)
-' Boolean
-'
-'**/
+'
+' Check if record exists
+'
+' Parameters:
+' Domain - data source (FROM part)
+' Criteria - (Optional) Criteria string (WHERE part)
+'
+' Returns:
+' Boolean
+'
'---------------------------------------------------------------------------------------
Public Function Exists(ByVal Domain As String, _
Optional ByVal Criteria As String = vbNullString) As Boolean
@@ -935,17 +946,18 @@ End Function
'---------------------------------------------------------------------------------------
' Function: InsertIdentityReturn
'---------------------------------------------------------------------------------------
-'/**
-'
-' Insert-SQL-Anweisung ausführen und letzten Identity-Wert (Autowert) zurückgeben
-'
-' Insert-SQL-Anweisung (INSERT ...)
-' Identity-Wert oder NULL falls kein Datensatz angefügt wurde
-'
-' Funktioniert erst ab Jet 4.0 (Access 2000) und ist vom DBMS abhängig. Bei MySQL-Tabellen wird z. B. 0 zurückgegeben.
-' (Die ADODB-Variante dieser Methode ist bezüglich Einsatz für aktive DBMS besser geeignet.)
-'
-'**/
+'
+' Execute insert SQL statement and return last identity value (auto value)
+'
+' Parameters:
+' InsertSQL - Insert SQL statement
+'
+' Returns:
+' Identity value or NULL if no record was appended
+'
+' Remarks:
+' Works for Jet only from Jet 4.0 (Access 2000), IdentityTable is only applicable for MSSQL, under MySQL the IDENT_CURRENT function does not exist.
+' ( is more suitable regarding use for active DBMS.)
'---------------------------------------------------------------------------------------
Public Function InsertIdentityReturn(ByVal InsertSql As String) As Variant
@@ -991,40 +1003,44 @@ End Function
'---------------------------------------------------------------------------------------
' Function: InsertValues
'---------------------------------------------------------------------------------------
-'/**
-'
-' Recordset öffnen und Werte eines Datensatzes anfügen
-'
-' Anfüge-Datenquelle
-' Auflistung: Feldname1, Wert1, Feldname2, Wert2, .. FeldnameN, WertN
-' True, wenn vollständig durchgeführt
-'
-' Da ein Recordset zum Einfügen verwendet wird, erfolgt im Code keine Datentyp-Prüfung -> auf implizite Konvertierung achten.
-'
-'**/
-'---------------------------------------------------------------------------------------
-Public Function InsertValues(ByVal SqlSource As String, ParamArray FieldsAndValues() As Variant) As Boolean
- InsertValues = InsertRecordValuesArrayReturnFieldValue(SqlSource, vbNullString, FieldsAndValues)
+'
+' Open recordset and append values
+'
+' Parameters:
+' Source - Insert data source
+' FieldsAndValues - ParamArray: "Field1", Value1, "Field2", Value2, ....
+'
+' Returns:
+' True if fully executed
+'
+' Remarks:
+' Since a recordset is used for insertion, there is no data type check in the code -> watch out for implicit conversion.
+'
+'---------------------------------------------------------------------------------------
+Public Function InsertValues(ByVal Source As String, ParamArray FieldsAndValues() As Variant) As Boolean
+ InsertValues = InsertRecordValuesArrayReturnFieldValue(Source, vbNullString, FieldsAndValues)
End Function
'---------------------------------------------------------------------------------------
' Function: InsertValuesReturnFieldValue
'---------------------------------------------------------------------------------------
-'/**
-'
-' Recordset öffnen und Werte eines Datensatzes anfügen, gibt Wert eine definierten Datenfeldes zurück
-'
-' Anfüge-Datenquelle
-' Datenfeld für Wertrückgabe
-' Auflistung: Feldname1, Wert1, Feldname2, Wert2, .. FeldnameN, WertN
-' Wert aus Datenfeld
-'
-' Da ein Recordset zum Einfügen verwendet wird, erfolgt im Code keine Datentyp-Prüfung -> auf implizite Konvertierung achten.
-'
-'**/
-'---------------------------------------------------------------------------------------
-Public Function InsertValuesReturnFieldValue(ByVal SqlSource As String, ByVal ReturnFieldNameOrIndex As Variant, ParamArray FieldsAndValues() As Variant) As Variant
- InsertValuesReturnFieldValue = InsertRecordValuesArrayReturnFieldValue(SqlSource, ReturnFieldNameOrIndex, FieldsAndValues)
+'
+' Ropen ecordset and append values, returns value of a defined data field
+'
+' Parameters:
+' Source - Insert data source
+' ReturnFieldNameOrIndex - Datenfeld für Wertrückgabe
+' FieldsAndValues - ParamArray: "Field1", Value1, "Field2", Value2, ....
+'
+' Returns:
+' Value from data field
+'
+' Remarks:
+' Since a recordset is used for insertion, there is no data type check in the code -> watch out for implicit conversion.
+'
+'---------------------------------------------------------------------------------------
+Public Function InsertValuesReturnFieldValue(ByVal Source As String, ByVal ReturnFieldNameOrIndex As Variant, ParamArray FieldsAndValues() As Variant) As Variant
+ InsertValuesReturnFieldValue = InsertRecordValuesArrayReturnFieldValue(Source, ReturnFieldNameOrIndex, FieldsAndValues)
End Function
Private Function InsertRecordValuesArrayReturnFieldValue( _
@@ -1094,23 +1110,23 @@ End Function
'---------------------------------------------------------------------------------------
' Function: NewRecord
'---------------------------------------------------------------------------------------
-'/**
-'
-' Datensatz über Recordset anfügen und Feldwerte einstellen.
-'
-' Datenquelle (Tabellenname oder SQL-Anweisung)
-' Feldname, dessen Wert zurückgegeben werden soll (z. B. Autowert-Feld)
-' Neue Daten ... abwechselnd: Feldname, Feldwert
-' Wert aus ReturnFieldName, oder True/False, falls kein ReturnFieldName festgelegt wurde
-'
-'
-'**/
+'
+' Append record via recordset and set field values.
+'
+' Parameters:
+' Source - Data source (table name or SQL statement)
+' ReturnFieldName - Field name whose value is to be returned (e.g. autonumber field).
+' FieldsAndValues - new data ... ParamArray: "Field1", Value1, "Field2", Value2, ....
+'
+' Returns:
+' Value from ReturnFieldName, or True/False if no ReturnFieldName was specified.
+'
'---------------------------------------------------------------------------------------
Public Function NewRecord(ByVal Source As String, ByVal ReturnFieldName As String, _
- ParamArray DataParams() As Variant) As Variant
+ ParamArray FieldsAndValues() As Variant) As Variant
Dim vA() As Variant
- vA = ConvertParamArrayToVariantArray(DataParams)
+ vA = ConvertParamArrayToVariantArray(FieldsAndValues)
NewRecord = NewRecord_FieldArray(Source, ReturnFieldName, vA)
End Function
@@ -1181,19 +1197,19 @@ End Function
'---------------------------------------------------------------------------------------
' Function: CopyRecord
'---------------------------------------------------------------------------------------
-'/**
-'
-' Datensatz kopieren und einzelne Werte ändern
-'
-' Datenquelle (Tabellenname oder SQL-Anweisung)
-' Datenfeld-Nr. ab der die Daten kopiert werden
-' Datenfeld-Nr. ab bis zu der die kopiert werden. Ein negativer Wert zähle von hinten.
-' Feldname, dessen Wert zurückgegeben werden soll (z. B. Autowert-Feld)
-' zu ändernde Daten ... abwechselnd: Feldname, Feldwert
-' Wert aus ReturnFieldName, oder True/False, falls kein ReturnFieldName festgelegt wurde
-'
-'
-'**/
+'
+' Copy data set and change individual values
+'
+' Parameters:
+' Source - Data source (table name or SQL statement)
+' StartFieldNumber - Data field number (=field index+1) from which the data is copied
+' LastFieldNumber - Data field number (=field index+1) up to which the data are copied. A negative value counts from behind.
+' ReturnFieldName - Field name whose value is to be returned (e.g. auto number field).
+' DataToChange - data to be changed ... alternating: field name, field value - ParamArray: "Field1", Value1, "Field2", Value2, ....
+'
+' Returns:
+' Value from ReturnFieldName, or True/False if no ReturnFieldName was specified.
+'
'---------------------------------------------------------------------------------------
Public Function CopyRecord(ByVal Source As String, _
ByVal StartFieldNumber As Long, ByVal LastFieldNumber As Long, _
@@ -1210,41 +1226,36 @@ End Function
Private Function CopyRecord_FieldArray(ByVal Source As String, _
ByVal StartFieldNumber As Long, ByVal LastFieldNumber As Long, _
ByVal ReturnFieldName As String, ByRef DataToChange() As Variant) As Variant
-'Datensätze kopieren
-' SQLFilter.....SQL.Text (Auswahl des zu kopierenden DS, !Feldnamen müssen den Namen der Tabelle entsprechen !)
-' StartFeldID...Ab welcher FeldNummer sollen Daten geändert werden (Anm. Autowert im DS nach vorne, dann ausklammern oder gleich in SQL nicht anführen
-' ctlChange.....abwechselnd Feldname und zugehörigen Wert eingeben z.B. "UserID","Testperson"
On Error GoTo HandleErr
- Dim lngNum As Long, i As Long, iDS As Long, anz As Long
- Dim strCtl() As Variant, valCtl() As Variant
- Dim rst As DAO.Recordset
- Dim lngLastCopyField As Long, dsAnz As Long, Start As Long
- Dim fCopyVal() As Variant
+ Dim lngNum As Long, i As Long, iDS As Long, anz As Long
+ Dim strCtl() As Variant, valCtl() As Variant
+ Dim rst As DAO.Recordset
+ Dim lngLastCopyField As Long, dsAnz As Long, Start As Long
+ Dim fCopyVal() As Variant
- 'Parameterübernahme
- lngNum = UBound(DataToChange) + 1
-
- anz = 0
- ReDim strCtl((lngNum \ 2) - 1)
- ReDim valCtl((lngNum \ 2) - 1)
+ lngNum = UBound(DataToChange) + 1
- For i = 0 To (lngNum - 2) Step 2
- strCtl(anz) = DataToChange(i)
- valCtl(anz) = DataToChange(i + 1)
- anz = anz + 1
- Next i
-
- 'Recordsetobjekt öffnen
- Set rst = OpenRecordset(Source, dbOpenDynaset)
+ anz = 0
+ ReDim strCtl((lngNum \ 2) - 1)
+ ReDim valCtl((lngNum \ 2) - 1)
+
+ For i = 0 To (lngNum - 2) Step 2
+ strCtl(anz) = DataToChange(i)
+ valCtl(anz) = DataToChange(i + 1)
+ anz = anz + 1
+ Next i
- If rst.EOF And rst.BOF Then
- rst.Close
- Set rst = Nothing
- CopyRecord_FieldArray = 0
- Exit Function
- End If
+ 'Recordsetobjekt öffnen
+ Set rst = OpenRecordset(Source, dbOpenDynaset)
+
+ If rst.EOF And rst.BOF Then
+ rst.Close
+ Set rst = Nothing
+ CopyRecord_FieldArray = 0
+ Exit Function
+ End If
With rst
.MoveLast
@@ -1313,43 +1324,45 @@ On Error Resume Next
Set rst = Nothing
End If
On Error GoTo 0
- Err.Raise FncErrNr, "CopyRecord_FieldArray", FncErrDesc
+ Err.Raise FncErrNr, "DaoHandler.CopyRecord_FieldArray", FncErrDesc
End Function
'---------------------------------------------------------------------------------------
' Function: CopyRecords
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Recordset öffnen und Werte eines Datensatzes anfügen
-'
-' Anfüge-Datenquelle
-' Datenfeld, ab dem kopiert werden soll (z. B. auf 1. Platz ist Autowert => ab 2 kopieren
-' Datenfeld, bis zu dem kopiert werden soll. Soderfälle: 0 = bis zum Ende, negative Wert = ab hinten gezählt
-' Auflistung der zu ändernden Felder inkl. deren Werte: Feldname1, Wert1, Feldname2, Wert2, .. FeldnameN, WertN
-' True, wenn vollständig durchgeführt
-'
-' Da ein Recordset zum Einfügen verwendet wird, erfolgt im Code keine Datentyp-Prüfung -> auf implizite Konvertierung achten.
-'
-'**/
-'---------------------------------------------------------------------------------------
-Public Function CopyRecords(ByVal SqlSource As String, _
- ByVal StartFeldID As Long, ByVal LastFeldID As Long, _
- ParamArray UpdateFieldsAndValues() As Variant) As Variant
+'
+' Parameters:
+' Source - Data source (table name or SQL statement)
+' StartFieldNumber - Data field number (=field index+1) from which the data is copied
+' LastFieldNumber - Data field number (=field index+1) up to which the data are copied. A negative value counts from behind.
+' DataToChange - data to be changed ... alternating: field name, field value - ParamArray: "Field1", Value1, "Field2", Value2, ....
+'
+' Returns:
+' Boolean - True if success
+'
+' Remarks:
+' Since a recordset is used for insertion, there is no data type check in the code -> watch out for implicit conversion.
+'
+'---------------------------------------------------------------------------------------
+Public Function CopyRecords(ByVal Source As String, _
+ ByVal StartFieldNumber As Long, ByVal LastFieldNumber As Long, _
+ ParamArray DataToChange() As Variant) As Boolean
Dim maxIdx As Long
Dim vA() As Variant
Dim i As Long
- maxIdx = UBound(UpdateFieldsAndValues)
+ maxIdx = UBound(DataToChange)
ReDim vA(maxIdx)
For i = 0 To maxIdx
- vA(i) = UpdateFieldsAndValues(i)
+ vA(i) = DataToChange(i)
Next i
- CopyRecords = CopyRecordsArrayReturnFieldValue(SqlSource, StartFeldID, LastFeldID, vbNullString, vA)
+ CopyRecords = CopyRecordsArrayReturnFieldValue(Source, StartFieldNumber, LastFieldNumber, vbNullString, vA)
End Function
@@ -1359,33 +1372,36 @@ End Function
'/**
'
' Datensätze kopieren und Werte ändern
-'
-' Anfüge-Datenquelle
-' Datenfeld, ab dem kopiert werden soll (z. B. auf 1. Platz ist Autowert => ab 2 kopieren
-' Datenfeld, bis zu dem kopiert werden soll. Soderfälle: 0 = bis zum Ende, negative Wert = ab hinten gezählt
-' Datenfeld für Wertrückgabe
-' Auflistung der zu ändernden Felder inkl. deren Werte: Feldname1, Wert1, Feldname2, Wert2, .. FeldnameN, WertN
-' Wert aus Datenfeld
-'
-' Da ein Recordset zum Einfügen verwendet wird, erfolgt im Code keine Datentyp-Prüfung -> auf implizite Konvertierung achten.
-'
-'**/
-'---------------------------------------------------------------------------------------
-Public Function CopyRecordsReturnFieldValue(ByVal SqlSource As String, _
- ByVal StartFeldID As Long, ByVal LastFeldID As Long, _
- ByVal ReturnField As String, _
- ParamArray UpdateFieldsAndValues() As Variant) As Variant
+'
+' Parameters:
+' Source - Data source (table name or SQL statement)
+' StartFieldNumber - Data field number (=field index+1) from which the data is copied
+' LastFieldNumber - Data field number (=field index+1) up to which the data are copied. A negative value counts from behind.
+' ReturnFieldName - Field name whose value is to be returned (e.g. auto number field).
+' DataToChange - data to be changed ... alternating: field name, field value - ParamArray: "Field1", Value1, "Field2", Value2, ....
+'
+' Returns:
+' Value from ReturnFieldName, or True/False if no ReturnFieldName was specified.
+'
+' Remarks:
+' Since a recordset is used for insertion, there is no data type check in the code -> watch out for implicit conversion.
+'
+'---------------------------------------------------------------------------------------
+Public Function CopyRecordsReturnFieldValue(ByVal Source As String, _
+ ByVal StartFieldNumber As Long, ByVal LastFieldNumber As Long, _
+ ByVal ReturnFieldName As String, _
+ ParamArray DataToChange() As Variant) As Variant
Dim maxIdx As Long
Dim vA() As Variant
Dim i As Long
- maxIdx = UBound(UpdateFieldsAndValues)
+ maxIdx = UBound(DataToChange)
ReDim vA(maxIdx)
For i = 0 To maxIdx
- vA(i) = UpdateFieldsAndValues(i)
+ vA(i) = DataToChange(i)
Next i
- CopyRecordsReturnFieldValue = CopyRecordsArrayReturnFieldValue(SqlSource, StartFeldID, LastFeldID, ReturnField, vA)
+ CopyRecordsReturnFieldValue = CopyRecordsArrayReturnFieldValue(Source, StartFieldNumber, LastFieldNumber, ReturnFieldName, vA)
End Function
@@ -1395,89 +1411,86 @@ Private Function CopyRecordsArrayReturnFieldValue(ByVal SqlSource As String, _
On Error GoTo HandleErr
- Dim lngNum As Long, lngAnz As Long, i As Long, iDS As Long, anz As Long
- Dim strCtl() As Variant, valCtl() As Variant
- Dim rst As Object
- Dim lngLastCopyField As Long, dsAnz As Long, Start As Long
- Dim CopyFieldsAndValues() As Variant
- Dim ErrNo As Long, ErrDesc As String, ErrSource As String
-
- 'Parameterübernahme
- lngNum = UBound(UpdateFieldsAndValues) - LBound(UpdateFieldsAndValues) + 1
+ Dim lngNum As Long, lngAnz As Long, i As Long, iDS As Long, anz As Long
+ Dim strCtl() As Variant, valCtl() As Variant
+ Dim rst As Object
+ Dim lngLastCopyField As Long, dsAnz As Long, Start As Long
+ Dim CopyFieldsAndValues() As Variant
+ Dim ErrNo As Long, ErrDesc As String, ErrSource As String
+
+ lngNum = UBound(UpdateFieldsAndValues) - LBound(UpdateFieldsAndValues) + 1
- anz = 0
- ReDim strCtl((lngNum \ 2) - 1)
- ReDim valCtl((lngNum \ 2) - 1)
+ anz = 0
+ ReDim strCtl((lngNum \ 2) - 1)
+ ReDim valCtl((lngNum \ 2) - 1)
- For i = 0 To (lngNum - 2) Step 2
- strCtl(anz) = UpdateFieldsAndValues(i)
- valCtl(anz) = UpdateFieldsAndValues(i + 1)
- anz = anz + 1
- Next i
+ For i = 0 To (lngNum - 2) Step 2
+ strCtl(anz) = UpdateFieldsAndValues(i)
+ valCtl(anz) = UpdateFieldsAndValues(i + 1)
+ anz = anz + 1
+ Next i
- 'Recordsetobjekt öffnen
- Set rst = Me.OpenRecordset(SqlSource, dbOpenDynaset)
+ Set rst = Me.OpenRecordset(SqlSource, dbOpenDynaset)
- If rst.EOF And rst.BOF Then
- rst.Close
- Set rst = Nothing
- CopyRecordsArrayReturnFieldValue = 0
- Exit Function
- End If
-
- With rst
- .MoveLast
- .MoveFirst
- dsAnz = .RecordCount
-
- If LastFeldID = 0 Then
- lngLastCopyField = .Fields.Count
- ElseIf LastFeldID < 0 Then
- lngLastCopyField = .Fields.Count + LastFeldID
- Else
- lngLastCopyField = LastFeldID
- End If
-
- ReDim CopyFieldsAndValues(dsAnz, lngLastCopyField)
-
- If StartFeldID > 1 Then Start = StartFeldID - 1 Else Start = 0
-
- 'Werte einlesen
- iDS = 0
- While Not .EOF
- For i = Start To lngLastCopyField - 1
- If .Fields(i).Type <> dbBinary Then
- CopyFieldsAndValues(iDS, i) = .Fields(i).Value
- End If
- Next i
- .MoveNext
- iDS = iDS + 1
- Wend
- .MoveLast
-
- 'Werte kopieren
- For iDS = 0 To (dsAnz - 1)
- 'neuen DS anfügen
- .AddNew
- For i = Start To (lngLastCopyField - 1)
- If .Fields(i).Type <> dbBinary Then
- .Fields(i) = CopyFieldsAndValues(iDS, i)
- End If
- Next i
- For i = 0 To (anz - 1)
- .Fields(strCtl(i)) = valCtl(i)
- Next i
- .Update
- Next iDS
-
- If Len(ReturnField & vbNullString) > 0 Then
- .Bookmark = .LastModified
- CopyRecordsArrayReturnFieldValue = .Fields(ReturnField)
- Else
- CopyRecordsArrayReturnFieldValue = True
- End If
- .Close
- End With
+ If rst.EOF And rst.BOF Then
+ rst.Close
+ Set rst = Nothing
+ CopyRecordsArrayReturnFieldValue = 0
+ Exit Function
+ End If
+
+ With rst
+ .MoveLast
+ .MoveFirst
+ dsAnz = .RecordCount
+
+ If LastFeldID = 0 Then
+ lngLastCopyField = .Fields.Count
+ ElseIf LastFeldID < 0 Then
+ lngLastCopyField = .Fields.Count + LastFeldID
+ Else
+ lngLastCopyField = LastFeldID
+ End If
+
+ ReDim CopyFieldsAndValues(dsAnz, lngLastCopyField)
+
+ If StartFeldID > 1 Then Start = StartFeldID - 1 Else Start = 0
+
+ 'Read values
+ iDS = 0
+ While Not .EOF
+ For i = Start To lngLastCopyField - 1
+ If .Fields(i).Type <> dbBinary Then
+ CopyFieldsAndValues(iDS, i) = .Fields(i).Value
+ End If
+ Next i
+ .MoveNext
+ iDS = iDS + 1
+ Wend
+ .MoveLast
+
+ 'Copy values
+ For iDS = 0 To (dsAnz - 1)
+ .AddNew
+ For i = Start To (lngLastCopyField - 1)
+ If .Fields(i).Type <> dbBinary Then
+ .Fields(i) = CopyFieldsAndValues(iDS, i)
+ End If
+ Next i
+ For i = 0 To (anz - 1)
+ .Fields(strCtl(i)) = valCtl(i)
+ Next i
+ .Update
+ Next iDS
+
+ If Len(ReturnField & vbNullString) > 0 Then
+ .Bookmark = .LastModified
+ CopyRecordsArrayReturnFieldValue = .Fields(ReturnField)
+ Else
+ CopyRecordsArrayReturnFieldValue = True
+ End If
+ .Close
+ End With
ExitHere:
Set rst = Nothing
diff --git a/source/codelib/data/defDbConnection.bas b/source/codelib/data/defDbConnection.bas
index 03ecf02..f13eadf 100644
--- a/source/codelib/data/defDbConnection.bas
+++ b/source/codelib/data/defDbConnection.bas
@@ -1,14 +1,12 @@
Attribute VB_Name = "defDbConnection"
'---------------------------------------------------------------------------------------
-' Modul: defDbConnection
+' Package: data.defDbConnection
'---------------------------------------------------------------------------------------
-'/**
-'
-' Sammlung von globalen Typen, Enums usw. für die DbConnection-Klassen
-'
-'
-'\ingroup data
-'**/
+'
+' Set of global types, enums etc. for the DbConnection classes
+'
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
'
' data/defDbConnection.bas
@@ -20,25 +18,19 @@ Option Compare Database
Option Explicit
'---------------------------------------------------------------------------------------
-'
-' Type + Enums
+' Group: Types
'
'---------------------------------------------------------------------------------------
' Type: DbmsConnectionStrings
'---------------------------------------------------------------------------------------
-'/**
-'
-' Type für die gleichzeitige Übergabe der Connectionsstrings
-'
-'
-' OledbConnectionStringOLEDB-Connectionstring für ADODB-Verbindung
-' OdbcConnectionStringODBC-Connectionstring für DAO-Verbindung
-' DatabaseFileDatenbankdateiname inkl. Pfad falls ein File-Backend eingesetzt wird
-'
-'
-'
-'**/
+'
+' Type for the simultaneous transfer of the connection strings
+'
+' OledbConnectionString - OLEDB connectionstring for ADODB connection
+' OdbcConnectionString - ODBC connectionstring for DAO connection
+' DatabaseFile - Database file name incl. path if a file backend is used
+'
'---------------------------------------------------------------------------------------
Public Type DbmsConnectionStrings
OledbConnectionString As String
@@ -47,21 +39,18 @@ Public Type DbmsConnectionStrings
End Type
+'---------------------------------------------------------------------------------------
+' Group: Enums
+'
+
'---------------------------------------------------------------------------------------
' Enum: DbmsConnectionModes
'---------------------------------------------------------------------------------------
-'/**
-'
-' DbmsConnectionModes
-'
-'
-' DMBS_DSNless (1)ohne DSN
-' DMBS_DSN (2)mit DSN
-' aDBMS_USERDEF (128)benutzerdefinierte Connectionstrings
-'
-'
-'
-'**/
+'
+' DMBS_DSNless - (1) without DSN
+' DMBS_DSN - (2) with DSN
+' DBMS_USERDEF - (128) User-defined connection strings
+'
'---------------------------------------------------------------------------------------
Public Enum DbmsConnectionModes
DMBS_DSNless = 1 'ohne DSN
diff --git a/source/codelib/data/modDbConnection.bas b/source/codelib/data/modDbConnection.bas
index f2a90e5..624e3d5 100644
--- a/source/codelib/data/modDbConnection.bas
+++ b/source/codelib/data/modDbConnection.bas
@@ -1,14 +1,18 @@
Attribute VB_Name = "modDbConnection"
'---------------------------------------------------------------------------------------
-' Modul: modDbConnection
+' Package: data.modDbConnection
'---------------------------------------------------------------------------------------
-'/**
-'
-' Sammlung von Prozeduren für die DbConnectionManager-Klasse
-'
-' Dient zum Instanzieren von DbConnectionManager und für den Zugriff auf die Hauptelemente von DbConnectionManager
-'\ingroup data
-'**/
+'
+' Collection of procedures for the DbConnectionManager class
+'
+' Author:
+' Josef Poetzl
+'
+' Remarks:
+' Used to instantiate DbConnectionManager and access the main elements of DbConnectionManager.
+'
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
'
' data/modDbConnection.bas
@@ -23,20 +27,22 @@ Option Private Module
Private m_DbConnectionManager As DbConnectionManager ' Hauptsteuerung
-'
+'#######################################################################################
+' Group: Factories
+
'---------------------------------------------------------------------------------------
' Property: DbCon
'---------------------------------------------------------------------------------------
-'/**
-'
-' Zugriff auf DbConnection der Haupt-DbConnectionManager-Instanz
-'
-' DbConnectionHandler
-'
-' Erleichtert den Aufruf, da das Schreiben der DbConnectionManager-Instanz-Variablen entfällt.
-' Beim ersten Zugriff wird die Instanz der DbConnectionManager-Klasse erstellt, falls diese noch nicht vorhanden ist.
-'
-'**/
+'
+' Access to DbConnection of the main DbConnectionManager instance
+'
+' Returns:
+' DbConnectionHandler
+'
+' Remarks:
+' Simplifies the call, as the writing of the DbConnectionManager instance variables is omitted.
+' The first access creates the instance of the DbConnectionManager class if it does not already exist.
+'
'---------------------------------------------------------------------------------------
Public Property Get DbCon() As DbConnectionHandler
@@ -50,16 +56,16 @@ End Property
'---------------------------------------------------------------------------------------
' Property: CurrentConnectionInfo
'---------------------------------------------------------------------------------------
-'/**
-'
-' Zugriff auf DbConnectionInfo der Haupt-DbConnectionManager-Instanz
-'
-' DbConnectionInfo
-'
-' Erleichtert den Aufruf, da das Schreiben der DbConnectionManager-Instanz-Variablen entfällt.
-' Beim ersten Zugriff wird die Instanz der DbConnectionManager-Klasse erstellt, falls diese noch nicht vorhanden ist.
-'
-'**/
+'
+' Access to DbConnectionInfo of the main DbConnectionManager instance
+'
+' Returns:
+'
+'
+' Remarks:
+' Simplifies the call, as the writing of the DbConnectionManager instance variables is omitted.
+' The first access creates the instance of the DbConnectionManager class if it does not already exist.
+'
'---------------------------------------------------------------------------------------
Public Property Get CurrentConnectionInfo() As DbConnectionInfo
@@ -70,17 +76,18 @@ Public Property Get CurrentConnectionInfo() As DbConnectionInfo
End Property
+'#######################################################################################
+' Group: Global Procedures
+
'---------------------------------------------------------------------------------------
' Function: CheckConnectionStatus
'---------------------------------------------------------------------------------------
-'/**
-'
-' Verbindung prüfen DbConnectionManager.CheckConnectionStatus
-'
-' Boolean: True = Verbindungsaufbau war erfolgreich
-'
-'
-'**/
+'
+' Verbindung prüfen (call )
+'
+' Return:
+' Boolean - True if success
+'
'---------------------------------------------------------------------------------------
Public Function CheckConnectionStatus() As Boolean
@@ -91,6 +98,13 @@ Public Function CheckConnectionStatus() As Boolean
End Function
+'---------------------------------------------------------------------------------------
+' Sub: DisposeDbConnection
+'---------------------------------------------------------------------------------------
+'
+' Dispose DbConnection objects (incl. DbConnectionManager)
+'
+'---------------------------------------------------------------------------------------
Public Sub DisposeDbConnection()
On Error Resume Next
@@ -102,24 +116,35 @@ On Error Resume Next
End Sub
-
'############################
'
' Hilfsfunktionen
-Public Function TableDefExists(ByVal sTableDefName As String, Optional ByRef dbs As DAO.Database = Nothing) As Boolean
+'---------------------------------------------------------------------------------------
+' Function: TableDefExists
+'---------------------------------------------------------------------------------------
+'
+' Check if TableDef exists
+'
+' Parameters:
+' TableDefName - (String) TableDef name
+' db - (DAO.Database) Database to use (optional: if nothing CurrentDb will be used)
+'
+'---------------------------------------------------------------------------------------
+Public Function TableDefExists(ByVal TableDefName As String, _
+ Optional ByVal db As DAO.Database = Nothing) As Boolean
'Schneller wäre der Zugriff auf MSysObject (select .. from MSysObject where Name = 'Tabellenname' AND Type IN (1, 4, 6)
'Eine weitere Alternative wäre das Auswerten über cnn.OpenSchema(adSchemaTables, ...) ... dann werden allerdings keine verknüpften Tabellen geprüft
Dim tdf As DAO.TableDef
- If dbs Is Nothing Then
- Set dbs = CurrentDb
+ If db Is Nothing Then
+ Set db = CurrentDb
End If
- dbs.TableDefs.Refresh
- For Each tdf In dbs.TableDefs
- If tdf.Name = sTableDefName Then
+ db.TableDefs.Refresh
+ For Each tdf In db.TableDefs
+ If tdf.Name = TableDefName Then
TableDefExists = True
Exit For
End If
@@ -127,17 +152,29 @@ Public Function TableDefExists(ByVal sTableDefName As String, Optional ByRef dbs
End Function
-Public Function QueryDefExists(ByVal sQueryDefName As String, Optional ByVal dbs As DAO.Database = Nothing) As Boolean
+'---------------------------------------------------------------------------------------
+' Function: QueryDefExists
+'---------------------------------------------------------------------------------------
+'
+' Check if QueryDef exists
+'
+' Parameters:
+' QueryDefName - (String) QueryDef name
+' db - (DAO.Database) Database to use (optional: if nothing CurrentDb will be used)
+'
+'---------------------------------------------------------------------------------------
+Public Function QueryDefExists(ByVal QueryDefName As String, _
+ Optional ByVal db As DAO.Database = Nothing) As Boolean
Dim qdf As DAO.QueryDef
- If dbs Is Nothing Then
- Set dbs = CurrentDb
+ If db Is Nothing Then
+ Set db = CurrentDb
End If
- dbs.QueryDefs.Refresh
- For Each qdf In dbs.QueryDefs
- If qdf.Name = sQueryDefName Then
+ db.QueryDefs.Refresh
+ For Each qdf In db.QueryDefs
+ If qdf.Name = QueryDefName Then
QueryDefExists = True
Exit For
End If
diff --git a/source/codelib/data/odbc/OdbcHandler.cls b/source/codelib/data/odbc/OdbcHandler.cls
index 2f1a057..1cff5a8 100644
--- a/source/codelib/data/odbc/OdbcHandler.cls
+++ b/source/codelib/data/odbc/OdbcHandler.cls
@@ -8,16 +8,16 @@ Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'---------------------------------------------------------------------------------------
-' Class: OdbcHandler
+' Class: data.odbc.OdbcHandler
'---------------------------------------------------------------------------------------
-'/**
-' \author Josef Poetzl
-'
-' ODBC-Zugriffsmethoden
-'
-'
-'\ingroup data_odbc
-'**/
+'
+' ODBC data connection methods
+'
+' Author:
+' Josef Poetzl
+'
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
'
' data/odbc/OdbcHandler.cls
@@ -32,75 +32,106 @@ Option Explicit
Private Const ERRNR_NOCONFIG As Long = vbObjectError + 1002
-'ODBC-Connectionstring
+'ODBC connection string
Private m_OdbcConnectionString As String
-'DAO-Database
-Private m_DaoDb As DAO.Database 'lokale Database-Instanz ... z. B. zum Erstellen von Temp-QueryDef
-Private m_DaoDbBE As DAO.Database 'BE (Database-Instanz über ODBC-Connection)
-
-'Error-Events für mögliche Fehlerbehandlung über die FE-Anwendung
-'/**
-'
-' Ereignis für fehlende CurrentDb-Referenz
-'
-' Meldung über Ursache der Ereignisauslösung. (Wird noch nicht genutzt)
-' DAO.Database-Referenz, die für CurrentDb verwendet werden soll
-' über den ByRef-Parameter NewCurrentDbRef kann die passende DAO.Database-Referenz weitergegeben werden.
-'**/
+'DAO Database
+Private m_DaoDb As DAO.Database 'local database instance ... e.g. to create Temp-QueryDef
+Private m_DaoDbBE As DAO.Database 'Backend (database instance via ODBC connection)
+
+'#############################################################
+' Group: Events
+
+'---------------------------------------------------------------------------------------
+' Event: ErrorMissingCurrentDb
+'---------------------------------------------------------------------------------------
+' Event for missing CurrentDb reference
+'
+' Parameters:
+' Msg - Message about the cause of the event triggering. (Not yet used)
+' NewCurrentDbRef - DAO.Database reference to be used for CurrentDb
+'
+' Remarks:
+' The required DAO.Database reference can be passed on via the ByRef parameter NewCurrentDbRef.
+'
+'---------------------------------------------------------------------------------------
Public Event ErrorMissingCurrentDb(ByVal Msg As String, ByRef NewCurrentDbRef As DAO.Database)
-'/**
-'
-' Ereignis für fehlenden ODBC-Connectionstring
-'
-' Meldung über Ursache der Ereignisauslösung. (Wird noch nicht genutzt)
-' ODBC-Connectionstring
-'
-' Über den ByRef-Parameter NewConnectionString kann der passende ODBC-Connectionstring weitergegeben werden.
-'
-'**/
+'---------------------------------------------------------------------------------------
+' Event: ErrorEmptyConnectionString
+'---------------------------------------------------------------------------------------
+'
+' Event for missing ODBC connection string
+'
+' Parameters:
+' Msg - Message about the cause of the event triggering. (Not yet used)
+' NewConnectionString - ODBC Connectionstring
+'
+' Remarks:
+' The appropriate ODBC connection string can be passed on via the ByRef parameter NewConnectionString.
+'
+'---------------------------------------------------------------------------------------
Public Event ErrorEmptyConnectionString(ByVal Msg As String, ByRef NewConnectionString As String)
-'Informations-Ereignisse
-'/**
-'
-' Info über das zuletzt verknüpfte Element
-'
-' Meldung über Ursache der Ereignisauslösung. (Wird noch nicht genutzt)
-' Anzahl der verknüpften Elemente seit Aufruf der Methode
-' Wird in der Methode #RelinkTablesAndQueries genutzt.
-'**/
-Public Event DbObjectRelinked(ByVal LastDbObjectName As String, ByVal lCounter As Long)
-
-'/**
-'
-' Info über das zuletzt gelöschte Element
-'
-' Name des zuletzt gelöschten Elements
-' Anzahl der gelöschten Elemente seit Aufruf der Methode
-' Wird in der Methode #DeleteOdbcTableDefs genutzt.
-'**/
-Public Event DbObjectDeleted(ByVal LastDbObjectName As String, ByVal lCounter As Long)
-
-'/**
-'
-' Event zum Anfagen von InsertIdentityReturn um die Sql-Anweisung zu ändern bzw. Ergebnis von außen einfließen zu lassen
-'
-' Insert-SQL-Anweisung (kann mittels Hook geändert werden)
-' Aktuell genutzte Datenbank
-' SQL-Anweisung zum Auswerten des letzen Identity-Wertes (kann mittels Hook geändert werden)
-' Anweisung für die Weiterarbeit in der Prozedur
-' Rückgabewert
-' Wird in der Methode #DeleteOdbcTableDefs genutzt.
-'**/
+'---------------------------------------------------------------------------------------
+' Event: DbObjectRelinked
+'---------------------------------------------------------------------------------------
+'
+' Info about the last linked element
+'
+' Parameters:
+' LastDbObjectName - the last linked table or view
+' Counter - Number of linked elements since the method was called
+'
+' Remarks:
+' Used in the RelinkTablesAndQueries method.
+'
+'---------------------------------------------------------------------------------------
+Public Event DbObjectRelinked(ByVal LastDbObjectName As String, ByVal Counter As Long)
+
+'---------------------------------------------------------------------------------------
+' Event: DbObjectDeleted
+'---------------------------------------------------------------------------------------
+'
+' Info about the last deleted element
+'
+' Parameters:
+' LastDbObjectName - the last deleted table or view
+' Counter - Number of deleted elements since the method was called
+'
+' Remarks:
+' Used in the RelinkTablesAndQueries method.
+'
+'---------------------------------------------------------------------------------------
+Public Event DbObjectDeleted(ByVal LastDbObjectName As String, ByVal Counter As Long)
+
+'---------------------------------------------------------------------------------------
+' Event: HookInsertIdentityReturn
+'---------------------------------------------------------------------------------------
+'
+' Event for missing OLEDB connection string
+'
+' Parameters:
+' InsertSql - SQL text of insert statement
+' ActiveDb - ADODB Connection to use
+' IdentitySelectString - Input string to use
+' HookResponseMode - resume action after event call: 0 ... code resume after event, 1 exit function after event
+' HookResponseMessage - return value of function (e.g. InsertIdentityReturn) when HookResponseMode <> 0
+'
+' Remarks:
+' New values can be passed on via the ByRef parameters.
+'
+'---------------------------------------------------------------------------------------
Public Event HookInsertIdentityReturn(ByRef InsertSql As String, _
ByRef ActiveDb As DAO.Database, _
ByRef IdentitySelectString As String, _
- ByRef ResponseMode As Long, ByRef ResponseMessage As Variant)
+ ByRef ResponseMode As Long, ByRef HookResponseMessage As Variant)
Private m_HooksEnabled As Boolean
+'#############################################################
+' Group: Class control
+
'
' Init / Terminate
' ----------------
@@ -126,6 +157,15 @@ On Error Resume Next
End Sub
+'---------------------------------------------------------------------------------------
+' Property: HooksEnabled
+'---------------------------------------------------------------------------------------
+' Active Hooks
+'
+' Remarks:
+' Used in InsertIdentityReturn
+'
+'---------------------------------------------------------------------------------------
Friend Property Get HooksEnabled() As Boolean
HooksEnabled = m_HooksEnabled
End Property
@@ -134,16 +174,15 @@ Friend Property Let HooksEnabled(ByVal NewValue As Boolean)
m_HooksEnabled = NewValue
End Property
+'#############################################################
+' Group: Data Connection
+
'---------------------------------------------------------------------------------------
' Property: CurrentDb
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' DAO.Database-Instanz des Frontends bzw. jener Jet-DB in der die Pass-Through-Abfragen erstellt werden sollen
-'
-' DAO.Database
-'
-'**/
+'
'---------------------------------------------------------------------------------------
Public Property Get CurrentDb() As DAO.Database
If (m_DaoDb Is Nothing) Then
@@ -153,18 +192,6 @@ Public Property Get CurrentDb() As DAO.Database
Set CurrentDb = m_DaoDb
End Property
-'---------------------------------------------------------------------------------------
-' Property: CurrentDb
-'---------------------------------------------------------------------------------------
-'/**
-'
-' DAO.Database-Instanz des Frontends bzw. jener Jet-DB in der die Pass-Through-Abfragen erstellt werden sollen
-'
-' DAO.Database-Referenz die für CurrentDb verwendet werden soll
-' DAO.Database
-'
-'**/
-'---------------------------------------------------------------------------------------
Public Property Set CurrentDb(ByRef NewCurrentDb As DAO.Database)
Set m_DaoDb = NewCurrentDb
End Property
@@ -172,13 +199,12 @@ End Property
'---------------------------------------------------------------------------------------
' Property: CurrentDbBE
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Database-Referenz zum Backend
-'
-' DAO.Database
-' DAO.Database wird über DBEngine.OpenDatabase("", dbDriverComplete, False, ConnectionString) geöffnet.
-'**/
+'
+' Remarks
+' DAO.Database wird über DBEngine.OpenDatabase("", dbDriverComplete, False, ) geöffnet.
+'
'---------------------------------------------------------------------------------------
Public Property Get CurrentDbBE() As DAO.Database
Dim tempOdbConnectionstring As String
@@ -191,18 +217,6 @@ Public Property Get CurrentDbBE() As DAO.Database
Set CurrentDbBE = m_DaoDbBE
End Property
-'---------------------------------------------------------------------------------------
-' Property: CurrentDbBE
-'---------------------------------------------------------------------------------------
-'/**
-'
-' Database-Referenz zum Backend
-'
-' DAO.Database-Referenz auf eine bereits geöffnete Datanbank
-' DAO.Database
-' Diese Set-Property-Prozedur ist normalerweise nicht erforderlich, da die Datanbank überlicherweise mittels angegebenen ODBC-Connectionstring geöffnet wird.
-'**/
-'---------------------------------------------------------------------------------------
Public Property Set CurrentDbBE(ByRef NewCurrentDbBE As DAO.Database)
CloseDaoDbBE
Set m_DaoDbBE = NewCurrentDbBE
@@ -215,13 +229,12 @@ End Property
'---------------------------------------------------------------------------------------
' Property: ConnectionString
'---------------------------------------------------------------------------------------
-'/**
-'
-' ODBC-ConnectionString
-'
-' String
-'
-'**/
+'
+' ODBC Connection string
+'
+' Remarks:
+' Example - "ODBC;DRIVER={SQL Server};DATABASE=testdb;SERVER=(local)\SQL2005;Trusted_Connection=Yes;"
+'
'---------------------------------------------------------------------------------------
Public Property Get ConnectionString() As String
If Len(m_OdbcConnectionString) = 0 Then
@@ -237,17 +250,6 @@ On Error GoTo 0
ConnectionString = m_OdbcConnectionString
End Property
-'---------------------------------------------------------------------------------------
-' Property: ConnectionString
-'---------------------------------------------------------------------------------------
-'/**
-'
-' ODBC-ConnectionString
-'
-' ODBC-Connectionstring für Verbindungsaufbau
-' Beispiel: "ODBC;DRIVER={SQL Server};DATABASE=testdb;SERVER=(local)\SQL2005;Trusted_Connection=Yes;"
-'**/
-'---------------------------------------------------------------------------------------
Public Property Let ConnectionString(ByVal Value As String)
If m_OdbcConnectionString = Value Then
Exit Property
@@ -259,17 +261,20 @@ End Property
'---------------------------------------------------------------------------------------
' Function: OpenRecordset
'---------------------------------------------------------------------------------------
-'/**
-'
-' openRecordset
-'
-' SQL-Anweisung
-' DAO.RecordsetTypeEnum (Standard: dbOpenForwardOnly)
-' DAO.RecordsetOptionEnum (Standard: dbSeeChanges)
-' DAO.LockTypeEnum (Standard: dbOptimistic)
-' DAO.Recordset
-'
-'**/
+'
+' Open DAO.Recordset
+'
+' Parameters:
+' Source - SQL statement or table or query name
+' RecordsetType - DAO.RecordsetTypeEnum (Standard: dbOpenDynaset)
+' RecordsetOptions - DAO.RecordsetOptionEnum (Standard: dbSeeChanges)
+' LockEdit - DAO.LockTypeEnum (Standard: dbOptimistic)
+'
+' Returns:
+' DAO.Recordset
+'
+' Remarks:
+' Uses to open the recordset.
'---------------------------------------------------------------------------------------
Public Function OpenRecordset(ByVal Source As String, _
Optional ByVal RecordsetType As DAO.RecordsetTypeEnum = dbOpenForwardOnly, _
@@ -283,21 +288,23 @@ Public Function OpenRecordset(ByVal Source As String, _
End Function
-
'---------------------------------------------------------------------------------------
' Function: OpenRecordsetPT
'---------------------------------------------------------------------------------------
-'/**
-'
-' OpenRecordsetPT
-'
-' SQL-Anweisung
-' DAO.RecordsetTypeEnum (Standard: dbOpenForwardOnly)
-' DAO.RecordsetOptionEnum (Standard: dbSeeChanges+dbSQLPassThrough)
-' DAO.LockTypeEnum (Standard: dbOptimistic)
-' DAO.Recordset
-'
-'**/
+'
+' Open Pass Through DAO.Recordset
+'
+' Parameters:
+' Source - SQL statement or table or query name
+' RecordsetType - DAO.RecordsetTypeEnum (Standard: dbOpenDynaset)
+' RecordsetOptions - DAO.RecordsetOptionEnum (Standard: dbSeeChanges+dbSQLPassThrough)
+' LockEdit - DAO.LockTypeEnum (Standard: dbOptimistic)
+'
+' Returns:
+' DAO.Recordset
+'
+' Remarks:
+' Uses to open the recordset.
'---------------------------------------------------------------------------------------
Public Function OpenRecordsetPT(ByVal Source As String, _
Optional ByVal RecordsetType As DAO.RecordsetTypeEnum = dbOpenForwardOnly, _
@@ -330,14 +337,16 @@ End Function
'---------------------------------------------------------------------------------------
' Function: Execute
'---------------------------------------------------------------------------------------
-'/**
-'
-' DAO.Execute-Anweisung über #CurrentDbBE
-'
-' SQL-Anweisung im Jet-SQL-Dialekt
-' Werte von RecordsetOptionEnum analog DAO.Database.Execute
-' Long (Anzahl der betroffenen Datensätze)
-'**/
+'
+' Execute SQL statement (CurrentDbBE.Execute)
+'
+' Parameters:
+' CommandText - SQL statement (String)
+' Options - DAO.RecordsetOptionEnum
+'
+' Returns:
+' RecordsAffected (Long)
+'
'---------------------------------------------------------------------------------------
Public Function Execute(ByVal CommandText As String, _
Optional ByVal Options As DAO.RecordsetOptionEnum) As Long
@@ -357,15 +366,16 @@ End Function
'---------------------------------------------------------------------------------------
' Sub: ExecutePT
-'---------------------------------------------------------------------------------------
-'/**
-'
-' Execute-Anweisung über eine Pass-Through-Abfrage.
-'
-' SQL-Anweisung im SQL-Dialekt des DBMS
-' Werte von RecordsetOptionEnum analog DAO.CreateQueryDef.Execute
-' Long (Anzahl der betroffenen Datensätze)
-'**/
+'---------------------------------------------------------------------------------------'
+' Execute SQL statement with Pass Trough Query
+'
+' Parameters:
+' CommandText - SQL statement (String)
+' Options - DAO.RecordsetOptionEnum (Default: DAO.RecordsetOptionEnum.dbSQLPassThrough)
+'
+' Returns:
+' RecordsAffected (Long)
+'
'---------------------------------------------------------------------------------------
Public Function ExecutePT(ByVal CommandText As String, _
Optional ByVal Options As DAO.RecordsetOptionEnum = DAO.RecordsetOptionEnum.dbSQLPassThrough _
@@ -397,16 +407,21 @@ End Function
'---------------------------------------------------------------------------------------
' Function: LookupSQL
'---------------------------------------------------------------------------------------
-'/**
-'
-' Lookup-Recordset-Ersatzfunktion für die Übergabe einer kompletten SQL-Anweisung
-'
-' SQL-Anweisung
-' Feldauswahl, falls nicht das erste Feld des Recordsets zurückgegeben werden soll
-' Rückgabewert bei fehlendem Datensatz oder NULL-Feldwert (Standard: Null
-' Variant
-'
-'**/
+'
+' Lookup DAO.Recordset replacement function for DLookup (passing a SQL statement) via CurrentDbBE
+'
+' Parameters:
+' SqlText - SQL statement
+' Index - Field selection if the first field of the recordset is not to be returned.
+' The index is passed in the same way as ADODB.Recordset.Fields(index).
+' ValueIfNull - Return value if record is missing or data field value is Null (default: Null).
+'
+' Returns:
+' Variant - Null, if SQL statement does not return a record.
+'
+' Remarks:
+' The SQL statement must be written in the Jet/ACE SQL dialect.
+'
'---------------------------------------------------------------------------------------
Public Function LookupSql(ByVal SqlText As String, _
Optional ByVal Index As Variant = 0&, _
@@ -443,16 +458,21 @@ End Function
'---------------------------------------------------------------------------------------
' Function: LookupSqlPT
'---------------------------------------------------------------------------------------
-'/**
-'
-' Lookup-Recordset-Ersatzfunktion für die Übergabe einer kompletten SQL-Anweisung
-'
-' SQL-Anweisung
-' Feldauswahl, falls nicht das erste Feld des Recordsets zurückgegeben werden soll
-' Rückgabewert bei fehlendem Datensatz oder NULL-Feldwert (Standard: Null
-' Variant
-'
-'**/
+'
+' Lookup DAO.Recordset replacement function for DLookup (passing a SQL statement) via Pass Through Query
+'
+' Parameters:
+' SqlText - SQL statement
+' Index - Field selection if the first field of the recordset is not to be returned.
+' The index is passed in the same way as ADODB.Recordset.Fields(index).
+' ValueIfNull - Return value if record is missing or data field value is Null (default: Null).
+'
+' Returns:
+' Variant - Null, if SQL statement does not return a record.
+'
+' Remarks:
+' The SQL statement must be written in the SQL dialect of backend (e. g. T-SQL for SQL-Server)
+'
'---------------------------------------------------------------------------------------
Public Function LookupSqlPT(ByVal SqlText As String, _
Optional ByVal Index As Variant = 0&, _
@@ -489,16 +509,18 @@ End Function
'---------------------------------------------------------------------------------------
' Function: Lookup
'---------------------------------------------------------------------------------------
-'/**
-'
-' Lookup-Recordset-Ersatzfunktion
-'
-' Feldname oder berechneter Ausdruck (Select-Teil)
-' Tabelle, Abfrage oder SQL-Ausdruck für Sub-Abfrage (FROM-Teil)
-' Filter (WHERE-Teil)
-' Variant
-'
-'**/
+'
+' DAO.Recordset replacement function for DLookup (via CurrentDbBE)
+'
+' Parameters:
+' Expr - Field name or calculated expression (select part)
+' Domain - Table, query or SQL expression for sub-query (FROM part)
+' Criteria - (Optional) Criteria string (WHERE part)
+' ValueIfNull - Return value if record is missing or data field value is Null (default: Null).
+'
+' Returns:
+' Variant
+'
'---------------------------------------------------------------------------------------
Public Function Lookup(ByVal Expr As String, ByVal Domain As String, _
Optional ByVal Criteria As Variant, _
@@ -519,16 +541,17 @@ End Function
'---------------------------------------------------------------------------------------
' Function: Count
'---------------------------------------------------------------------------------------
-'/**
-'
-' DCount-Recordset-Ersatzfunktion
-'
-' Feldname oder berechneter Ausdruck (Select-Teil)
-' Tabelle, Abfrage oder SQL-Ausdruck für Sub-Abfrage (FROM-Teil)
-' Filter (WHERE-Teil)
-' Long
-'
-'**/
+'
+' DAO.Recordset replacement function for DCount (via CurrentDbBE)
+'
+' Parameters:
+' Expr - Field name or calculated expression (select part)
+' Domain - Table, query or SQL expression for sub-query (FROM part)
+' Criteria - (optional) Criteria string (WHERE part)
+'
+' Returns:
+' Long
+'
'---------------------------------------------------------------------------------------
Public Function Count(ByVal Expr As String, ByVal Domain As String, Optional ByVal Criteria As Variant) As Variant
Count = Nz(Me.Lookup("Count(" & Expr & ")", Domain, Criteria), 0)
@@ -537,16 +560,17 @@ End Function
'---------------------------------------------------------------------------------------
' Function: Max
'---------------------------------------------------------------------------------------
-'/**
-'
-' DMax-Recordset-Ersatzfunktion
-'
-' Feldname oder berechneter Ausdruck (Select-Teil)
-' Tabelle, Abfrage oder SQL-Ausdruck für Sub-Abfrage (FROM-Teil)
-' Filter (WHERE-Teil)
-' Variant
-'
-'**/
+'
+' DAO.Recordset replacement function for DMax (via CurrentDbBE)
+'
+' Parameters:
+' Expr - Field name or calculated expression (select part)
+' Domain - Table, query or SQL expression for sub-query (FROM part)
+' Criteria - (Optional) Criteria string (WHERE part)
+'
+' Returns:
+' Variant
+'
'---------------------------------------------------------------------------------------
Public Function Max(ByVal Expr As String, ByVal Domain As String, Optional ByVal Criteria As Variant) As Variant
Max = Me.Lookup("Max(" & Expr & ")", Domain, Criteria)
@@ -555,16 +579,17 @@ End Function
'---------------------------------------------------------------------------------------
' Function: Min
'---------------------------------------------------------------------------------------
-'/**
-'
-' DMin-Recordset-Ersatzfunktion
-'
-' Feldname oder berechneter Ausdruck (Select-Teil)
-' Tabelle, Abfrage oder SQL-Ausdruck für Sub-Abfrage (FROM-Teil)
-' Filter (WHERE-Teil)
-' Variant
-'
-'**/
+'
+' DAO.Recordset replacement function for DMin (via CurrentDbBE)
+'
+' Parameters:
+' Expr - Field name or calculated expression (select part)
+' Domain - Table, query or SQL expression for sub-query (FROM part)
+' Criteria - (Optional) Criteria string (WHERE part)
+'
+' Returns:
+' Variant
+'
'---------------------------------------------------------------------------------------
Public Function Min(ByVal Expr As String, ByVal Domain As String, Optional ByVal Criteria As Variant) As Variant
Min = Me.Lookup("Min(" & Expr & ")", Domain, Criteria)
@@ -573,16 +598,17 @@ End Function
'---------------------------------------------------------------------------------------
' Function: Sum
'---------------------------------------------------------------------------------------
-'/**
-'
-' DSum-Recordset-Ersatzfunktion
-'
-' Feldname oder berechneter Ausdruck (Select-Teil)
-' Tabelle, Abfrage oder SQL-Ausdruck für Sub-Abfrage (FROM-Teil)
-' Filter (WHERE-Teil)
-' Variant
-'
-'**/
+'
+' DAO.Recordset replacement function for DSum (via CurrentDbBE)
+'
+' Parameters:
+' Expr - Field name or calculated expression (select part)
+' Domain - Table, query or SQL expression for sub-query (FROM part)
+' Criteria - (Optional) Criteria string (WHERE part)
+'
+' Returns:
+' Variant
+'
'---------------------------------------------------------------------------------------
Public Function Sum(ByVal Expr As String, ByVal Domain As String, Optional ByVal Criteria As Variant) As Variant
Sum = Me.Lookup("Sum(" & Expr & ")", Domain, Criteria)
@@ -591,14 +617,18 @@ End Function
'---------------------------------------------------------------------------------------
' Function: InsertIdentityReturn
'---------------------------------------------------------------------------------------
-'/**
-'
-' Insert-SQL-Anweisung ausführen und letzten Identity-Wert (Autowert) zurückgeben
-'
-' Insert-SQL-Anweisung (INSERT ...)
-' Identity-Wert oder NULL falls kein Datensatz angefügt wurde
-' Funktioniert erst ab Jet 4.0 (Access 2000) und ist vom DBMS abhängig. Bei MySQL-Tabellen wird z. B. 0 zurückgegeben
-'**/
+'
+' Execute insert SQL statement and return last identity value (via CurrentDbBE)
+'
+' Parameters:
+' InsertSQL - Insert SQL statement
+'
+' Returns:
+' Identity value or NULL if no record was appended
+'
+' Remarks:
+' Works for Jet only from Jet 4.0 (Access 2000), IdentityTable is only applicable for MSSQL, under MySQL the IDENT_CURRENT function does not exist.
+' If HooksEnabled: event HookInsertIdentityReturn will be raised
'---------------------------------------------------------------------------------------
Public Function InsertIdentityReturn(ByVal InsertSql As String) As Variant
@@ -658,19 +688,24 @@ HandleErr:
End Function
+'#############################################################
+' Group: Linked Table Support
+
'---------------------------------------------------------------------------------------
' Sub: LinkTable
'---------------------------------------------------------------------------------------
-'/**
-'
-' Backend-Tabelle im Access-Frontend verknüpfen
-'
-' Tabelle im Backend
-' Tabelle im Frontend
-' ODBC-Passwort in Tabellenverknüpfung speichern
-' Schema-Kennung entfernen
-' Sollten eine 2-geteilte Tabellenkennung wie "dbo.Tabelle123" im BE vorliegen und bRemoveSchemaName auf false gesetzt sein, wird der Punkt durch "_" ersetzt.
-'**/
+'
+' Link backend table in Access frontend
+'
+' Parameters:
+' SourceTableName - Table or view in the backend
+' LinkedTableName - Table in frontend
+' SavePWD - Save ODBC password in linked table
+' RemoveSchemaName - Remove schema identifier
+'
+' Remarks:
+' If there is a 2-part table identifier like "dbo.Table123" in the BE and bRemoveSchemaName is set to false, the dot is replaced by "_".
+'
'---------------------------------------------------------------------------------------
Public Sub LinkTable(ByVal SourceTableName As String, _
Optional ByVal LinkedTableName As String = vbNullString, _
@@ -685,7 +720,7 @@ Public Sub LinkTable(ByVal SourceTableName As String, _
NewConnectionString = Me.ConnectionString
If Len(NewConnectionString) = 0 Then
Err.Raise ERRNR_NOCONFIG, _
- "LinkTable", "ODBC-Connectionstring fehlt!"
+ "LinkTable", "Missing ODBC connection string!"
End If
If Len(LinkedTableName) = 0 Then
@@ -693,7 +728,7 @@ Public Sub LinkTable(ByVal SourceTableName As String, _
If RemoveSchemaName Then
Pos = InStr(1, LinkedTableName, ".")
If Pos > 0 Then
- LinkedTableName = Mid$(LinkedTableName, Pos + 1) ' nur Text nach Punkt verwenden
+ LinkedTableName = Mid$(LinkedTableName, Pos + 1) ' use only text after point
End If
End If
LinkedTableName = Replace(LinkedTableName, ".", "_")
@@ -701,15 +736,16 @@ Public Sub LinkTable(ByVal SourceTableName As String, _
Set dbs = Me.CurrentDb
dbs.TableDefs.Refresh
- 'Prüfen ob Tabelle bereits vorhanden und verknüpft ist.
+ 'Check if table already exists and is linked.
+' TODO: refactor for-each
For Each tdf In dbs.TableDefs
If tdf.Name = LinkedTableName Then
If tdf.SourceTableName = SourceTableName Then
RelinkTableDef tdf, NewConnectionString, SavePWD
Exit Sub
Else
- If MsgBox("Der SourceTableName der vorhandene Tabelle '" & LinkedTableName & "' ist '" & tdf.SourceTableName & "' und nicht " & SourceTableName & "'" & vbNewLine & _
- "Soll die vorhandene Tabelle mit der neuen Datenherkunft verknüpft werden?", vbCritical + vbYesNo + vbDefaultButton2) = vbYes Then
+ If MsgBox("The SourceTableName of the existing table '" & LinkedTableName & "' is '" & tdf.SourceTableName & "' and not '" & SourceTableName & "'" & vbNewLine & _
+ "Should the existing table be linked to the new data origin?", vbCritical + vbYesNo + vbDefaultButton2) = vbYes Then
dbs.TableDefs.Delete tdf.Name
Else
Exit Sub
@@ -737,20 +773,20 @@ End Sub
'---------------------------------------------------------------------------------------
' Function: RelinkTables
'---------------------------------------------------------------------------------------
-'/**
-'
-' RelinkTables
-'
-' ODBC-Passwort in Tabellenverknüpfung speichern
-' Hilfsparamter für Wertübergabe: Anzahl der Verknüpften Elemente für DbObjectRelinked-Ereignisaufruf
-' Long (Anzahl der verknüpften Tabellen)
-'
-'
-'**/
+'
+' Relink existing tables
+'
+' Parameters:
+' SavePWD - Save ODBC password in linked table
+' EventPeriod - Number of linked elements when the DbObjectRelinked event is to be called. (Default: 0 ... no event call).
+'
+' Returns:
+' Long - Number of linked tables
+'
'---------------------------------------------------------------------------------------
Public Function RelinkTables(Optional ByVal SavePWD As Boolean = False, _
Optional ByVal EventPeriod As Long = 0) As Long
-'EventPeriod = 0 ... Rückgabe ist deaktiviert
+'EventPeriod = 0 ... Return is disabled
Dim NewConnectionString As String
Dim RelinkedItemCnt As Long
@@ -758,7 +794,7 @@ Public Function RelinkTables(Optional ByVal SavePWD As Boolean = False, _
NewConnectionString = Me.ConnectionString
If Len(NewConnectionString) = 0 Then
Err.Raise ERRNR_NOCONFIG, _
- "RelinkTable", "ODBC-Connectionstring fehlt!"
+ "RelinkTable", "Missing ODBC connection string!"
End If
RelinkTablesWorker NewConnectionString, SavePWD, EventPeriod, RelinkedItemCnt
@@ -771,10 +807,11 @@ Private Sub RelinkTablesWorker(ByVal NewConnectionString As String, _
ByVal SavePWD As Boolean, _
ByVal EventPeriod As Long, _
ByRef RelinkedTableCounter As Long)
-'EventPeriod = 0 ... Rückgabe ist deaktiviert
+'EventPeriod = 0 ... Return is disabled
Dim dbs As DAO.Database
Dim tdf As DAO.TableDef
+ Dim LastTdfName As String
Set dbs = Me.CurrentDb
dbs.TableDefs.Refresh
@@ -784,28 +821,39 @@ Private Sub RelinkTablesWorker(ByVal NewConnectionString As String, _
If RelinkTableDef(tdf, NewConnectionString, SavePWD) Then
RelinkedTableCounter = RelinkedTableCounter + 1
If EventPeriod > 0 Then
+ LastTdfName = tdf.Name
If RelinkedTableCounter Mod EventPeriod = 0 Then
- RaiseEvent DbObjectRelinked(tdf.Name, RelinkedTableCounter)
+ RaiseEvent DbObjectRelinked(LastTdfName, RelinkedTableCounter)
End If
End If
End If
Next tdf
+
+ If EventPeriod > 0 Then
+ If RelinkedTableCounter Mod EventPeriod > 0 Then
+ RaiseEvent DbObjectRelinked(LastTdfName, RelinkedTableCounter)
+ End If
+ End If
End Sub
'---------------------------------------------------------------------------------------
' Sub: RelinkTable
'---------------------------------------------------------------------------------------
-'/**
-'
-' Verküpfte Tabelle mit möglicher Änderung der Server-Daten neu verknüpfen
-'
-' Tabelle im Frontend
-' ODBC-Passwort in Tabellenverknüpfung speichern
-' Boolean
-' Die TableDef-Eigenschaften SourceTableName wird nicht geändert
-'**/
+'
+' Relink linked table with possible change of server data
+'
+' Parameters:
+' LinkedTableName - Table in frontend
+' SavePWD - Save ODBC password in linked table
+'
+' Returns:
+' Boolean - success
+'
+' Remarks:
+' The TableDef property SourceTableName is not changed.
+'
'---------------------------------------------------------------------------------------
Public Function RelinkTable(ByVal LinkedTableName As String, _
Optional ByVal SavePWD As Boolean = False) As Boolean
@@ -817,7 +865,7 @@ Public Function RelinkTable(ByVal LinkedTableName As String, _
NewConnectionString = Me.ConnectionString
If Len(NewConnectionString) = 0 Then
Err.Raise ERRNR_NOCONFIG, _
- "RelinkTable", "ODBC-Connectionstring fehlt!"
+ "RelinkTable", "Missing ODBC connection string!"
End If
Set dbs = Me.CurrentDb
@@ -857,20 +905,20 @@ End Function
'---------------------------------------------------------------------------------------
' Function: RelinkPassThroughQueries
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Alle Pass-Through-Abfragen neu verknüpfen
-'
-' ODBC-Passwort in QueryDef speichern
-' Hilfsparamter für Wertübergabe: Anzahl der Verknüpften Elemente für DbObjectRelinked-Ereignisaufruf
-' Long (Anzahl der verknüpften Abfragen)
-'
-'
-'**/
+'
+' Parameters:
+' SavePWD - Save ODBC password in linked table
+' EventPeriod - Number of linked elements when the DbObjectRelinked event is to be called. (Default: 0 ... no event call).
+'
+' Returns:
+' Long - Number of linked pass through queries
+'
'---------------------------------------------------------------------------------------
Public Function RelinkPassThroughQueries(Optional ByVal SavePWD As Boolean = False, _
Optional ByVal EventPeriod As Long = 0) As Long
-'EventPeriod = 0 ... Rückgabe ist deaktiviert
+'EventPeriod = 0 ... Return is disabled
Dim NewConnectionString As String
Dim RelinkedItems As Long
@@ -878,7 +926,7 @@ Public Function RelinkPassThroughQueries(Optional ByVal SavePWD As Boolean = Fal
NewConnectionString = Me.ConnectionString
If Len(NewConnectionString) = 0 Then
Err.Raise ERRNR_NOCONFIG, _
- "RelinkTable", "ODBC-Connectionstring fehlt!"
+ "RelinkTable", "Missing ODBC connection string!"
End If
RelinkPassThroughQueriesWorker NewConnectionString, SavePWD, EventPeriod, RelinkedItems
@@ -891,10 +939,11 @@ Private Sub RelinkPassThroughQueriesWorker(ByVal NewConnectionString As String,
ByVal SavePWD As Boolean, _
ByVal EventPeriod As Long, _
ByRef RelinkCounter As Long)
-'EventPeriod = 0 ... Rückgabe ist deaktiviert
+'EventPeriod = 0 ... Return is disabled
Dim dbs As DAO.Database
Dim qdf As DAO.QueryDef
+ Dim LastQdfName As String
Set dbs = Me.CurrentDb
dbs.QueryDefs.Refresh
@@ -907,27 +956,36 @@ Private Sub RelinkPassThroughQueriesWorker(ByVal NewConnectionString As String,
If RelinkPassThroughQueryDef(qdf, NewConnectionString) Then
RelinkCounter = RelinkCounter + 1
If EventPeriod > 0 Then
+ LastQdfName = qdf.Name
If RelinkCounter Mod EventPeriod = 0 Then
- RaiseEvent DbObjectRelinked(qdf.Name, RelinkCounter)
+ RaiseEvent DbObjectRelinked(LastQdfName, RelinkCounter)
End If
End If
End If
qdf.Close
Next qdf
+
+ If EventPeriod > 0 Then
+ If RelinkCounter Mod EventPeriod > 0 Then
+ RaiseEvent DbObjectRelinked(LastQdfName, RelinkCounter)
+ End If
+ End If
End Sub
'---------------------------------------------------------------------------------------
' Sub: RelinkPassThroughQuery
'---------------------------------------------------------------------------------------
-'/**
-'
-' Pass-Through-Abfrage neu verknüpfen
-'
-' Abfragename im Frontend
-' ODBC-Passwort in QueryDef speichern
-' Mit ConnectionString kann vermieden werden, dass Benutzer u. Passwort gespeichert werden.
-'**/
+'
+' Relink pass through query
+'
+' Parameters:
+' QueryName - Table in frontend
+' SavePWD - Save ODBC password in pass throug query
+'
+' Returns:
+' Boolean - success
+'
'---------------------------------------------------------------------------------------
Public Function RelinkPassThroughQuery(ByVal QueryName As String, _
Optional ByVal SavePWD As Boolean = False) As Boolean
@@ -940,7 +998,7 @@ Public Function RelinkPassThroughQuery(ByVal QueryName As String, _
If Len(NewConnectionString) = 0 Then
Err.Raise ERRNR_NOCONFIG, _
- "RelinkPassThroughQuery", "ODBC-Connectionstring fehlt!"
+ "RelinkPassThroughQuery", "Missing ODBC connection string!"
End If
If Not SavePWD Then
@@ -971,55 +1029,55 @@ End Function
'---------------------------------------------------------------------------------------
' Sub: RelinkTablesAndQueries
'---------------------------------------------------------------------------------------
-'/**
-'
-' Alle verknüpften Tabellen und Pass-Through-Abfragen neu verknüpfen
-'
-' ODBC-Passwort in Tabellenverknüpfung bzw. QueryDef speichern
-' Hilfsparamter für Wertübergabe: Anzahl der Verknüpften Elemente für DbObjectRelinked-Ereignisaufruf
-' Long (Anzahl der verknüpften Tabellen und Abfragen)
-'
-' Je nach Einstellung von EventPeriod wird das Ereignis #DbObjectRelinked ausgelöst (0 = kein Ereignisaufruf, 1 = nach jedem Element Ereignis auslösen, 5 nach jedem 5. Element Ereignis auslösen,...).
-'
-'**/
+'
+' Relink all linked tables and pass-through queries
+'
+' Parameters:
+' SavePWD - Save ODBC password in linked table
+' EventPeriod - Number of linked elements when the DbObjectRelinked event is to be called. (Default: 0 ... no event call).
+'
+' Returns:
+' Long - Number of linked tables and queries
+'
'---------------------------------------------------------------------------------------
Public Function RelinkTablesAndQueries( _
Optional ByVal SavePWD As Boolean = False, _
Optional ByVal EventPeriod As Long = 0) As Long
Dim NewConnectionString As String
- Dim RelinkedTableCounter As Long
+ Dim RelinkedCounter As Long
NewConnectionString = Me.ConnectionString
If Len(NewConnectionString) = 0 Then
Err.Raise ERRNR_NOCONFIG, _
- "RelinkTablesAndQueries", "ODBC-Connectionstring fehlt!"
+ "RelinkTablesAndQueries", "Missing ODBC connection string!"
End If
- 'Tabellen
- RelinkTablesWorker NewConnectionString, SavePWD, EventPeriod, RelinkedTableCounter
+ 'Tables
+ RelinkTablesWorker NewConnectionString, SavePWD, EventPeriod, RelinkedCounter
- 'Pass-Through-Abfragen
- RelinkPassThroughQueriesWorker NewConnectionString, SavePWD, EventPeriod, RelinkedTableCounter
+ 'Pass through queries
+ RelinkPassThroughQueriesWorker NewConnectionString, SavePWD, EventPeriod, RelinkedCounter
- RelinkTablesAndQueries = RelinkedTableCounter
+ RelinkTablesAndQueries = RelinkedCounter
End Function
'---------------------------------------------------------------------------------------
' Function: DeleteOdbcTableDefs
'---------------------------------------------------------------------------------------
-'/**
-'
-' Alle verknüpften Tabelle im Frontend löschen. (Hat keine Auswirkung auf die Backend-Tabellen.)
-'
-' Hilfsparamter für Wertübergabe: Anzahl der gelöschen Elemente für DbObjectDeleted-Ereignisaufruf
-' Long (Anzahl der gelöschten Tabellen)
-'
-' Je nach Einstellung von lEventCounter wird das Ereignis #DbObjectDeleted ausgelöst
-' (0 = kein Ereignisaufruf, 1 = nach jedem Element Ereignis auslösen, 5 nach jedem 5. Element Ereignis auslösen,...).
-'
-'**/
+'
+' Delete all linked table in the frontend. (Has no effect on the backend tables).
+'
+' Parameters:
+' EventPeriod - Number of linked elements when the DbObjectRelinked event is to be called. (Default: 0 ... no event call).
+'
+' Returns:
+' Long - Number of deleted tables
+'
+' Remarks:
+' Depending on the setting of EventPeriod the event DbObjectDeleted is triggered
+'
'---------------------------------------------------------------------------------------
Public Function DeleteOdbcTableDefs(Optional ByVal EventPeriod As Long = 0) As Long
@@ -1101,10 +1159,36 @@ Private Sub AddTableDefAttribut(ByRef TdfRef As DAO.TableDef, ByRef Attr As Tabl
End Sub
+'---------------------------------------------------------------------------------------
+' Function: IsLinkedTable
+'---------------------------------------------------------------------------------------
+'
+' Check if TableDef is a linked table
+'
+' Parameters:
+' TableToCheck - TableDef reference to Access table in frontend
+'
+' Returns:
+' Boolean
+'
+'---------------------------------------------------------------------------------------
Public Function IsLinkedTable(ByVal TableToCheck As DAO.TableDef) As Boolean
IsLinkedTable = (Len(Trim$(TableToCheck.Connect)) > 0)
End Function
+'---------------------------------------------------------------------------------------
+' Function: IsPassThroughQuery
+'---------------------------------------------------------------------------------------
+'
+' Check if QueryDef is a pass through query
+'
+' Parameters:
+' QueryToCheck - QueryDef reference to Access query in frontend
+'
+' Returns:
+' Boolean
+'
+'---------------------------------------------------------------------------------------
Public Function IsPassThroughQuery(ByVal QueryToCheck As DAO.QueryDef) As Boolean
IsPassThroughQuery = (Len(Trim$(QueryToCheck.Connect)) > 0)
End Function
diff --git a/source/codelib/file/FileTools.bas b/source/codelib/file/FileTools.bas
index b2a620a..b12fcdd 100644
--- a/source/codelib/file/FileTools.bas
+++ b/source/codelib/file/FileTools.bas
@@ -1,15 +1,16 @@
Attribute VB_Name = "FileTools"
Attribute VB_Description = "Funktionen für Dateioperationen"
'---------------------------------------------------------------------------------------
-' Module: FileTools
+' Package: file.FileTools
'---------------------------------------------------------------------------------------
-'/**
-'\author Josef Poetzl
-'\short File operation functions
-'
-'
-'\ingroup file
-'**/
+'
+' File operation functions
+'
+' Author:
+' Josef Poetzl
+'
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
'
' file/FileTools.bas
@@ -93,19 +94,19 @@ Private Declare Function API_ShellExecuteA Lib "shell32.dll" ( _
'---------------------------------------------------------------------------------------
' Function: SelectFile
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Select file using dialogue
-'
-' Initial Folder
-' Title of dialogue
-' Filter settings - Example: "(*.*)" oder "All (*.*)|text files (*.txt)|Images (*.png;*.jpg;*.gif)
-' Multi-selection
-' View mode (0: Detail view, 1: Preview, 2: Properties, 3: List, 4: Thumbnail, 5: Large symbols, 6: Small symbols)
-' String (in case of multiple selection, the files are separated by chr(9))
-'
-'
-'**/
+'
+' Parameters:
+' InitDir - Initial Folder
+' DlgTitle - Title of dialogue
+' FilterString - Filter settings - Example: "(*.*)" oder "All (*.*)|text files (*.txt)|Images (*.png;*.jpg;*.gif)
+' MultiSelect - Multi-selection
+' ViewMode - View mode (0: Detail view, 1: Preview, 2: Properties, 3: List, 4: Thumbnail, 5: Large symbols, 6: Small symbols)
+'
+' Returns:
+' String - in case of multiple selection, the files are separated by chr(9))
+'
'---------------------------------------------------------------------------------------
Public Function SelectFile(Optional ByVal InitialDir As String = vbNullString, _
Optional ByVal DlgTitle As String = SELECTBOX_FILE_DIALOG_TITLE, _
@@ -120,19 +121,19 @@ End Function
'---------------------------------------------------------------------------------------
' Function: SelectFolder
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Folder selection dialogue
-'
-' Initial Folder
-' Title of dialogue
-' Filter settings, Default:*
-' Multi-selection
-' View mode (0: Detail view, 1: Preview, 2: Properties, 3: List, 4: Thumbnail, 5: Large symbols, 6: Small symbols)
-' String (in case of multiple selection, folders are separated by chr(9))
-'
-'
-'**/
+'
+' Parameters:
+' InitDir - Initial Folder
+' DlgTitle - Title of dialogue
+' FilterString - Filter settings, Default:*
+' MultiSelect - Multi-selection
+' ViewMode - View mode (0: Detail view, 1: Preview, 2: Properties, 3: List, 4: Thumbnail, 5: Large symbols, 6: Small symbols)
+'
+' Returns:
+' String - in case of multiple selection, folders are separated by chr(9))
+'
'---------------------------------------------------------------------------------------
Public Function SelectFolder(Optional ByVal InitialDir As String = vbNullString, _
Optional ByVal DlgTitle As String = SELECTBOX_FOLDER_DIALOG_TITLE, _
@@ -201,16 +202,16 @@ End Function
'---------------------------------------------------------------------------------------
' Function: UNCPath
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Returns the UNC path
-'
-' Path to convert
-' true = ignore API errors
-' String
-'
-'
-'**/
+'
+' Parameters:
+' Path - Path to convert
+' IgnoreErrors - true = ignore API errors
+'
+' Returns:
+' String
+'
'---------------------------------------------------------------------------------------
Public Function UncPath(ByVal Path As String, Optional ByVal IgnoreErrors As Boolean = True) As String
@@ -227,8 +228,7 @@ Public Function UncPath(ByVal Path As String, Optional ByVal IgnoreErrors As Boo
End If
Else
-
- ' Ergebnis zurückgeben:
+
UncPath = VBA.Left$(UNC, VBA.InStr(UNC, vbNullChar) - 1) & VBA.Mid$(Path, 3)
End If
@@ -238,15 +238,15 @@ End Function
'---------------------------------------------------------------------------------------
' Property: TempPath
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Determine Temp folder
-'
-' String
-'
-' Uses API GetTempPathA
-'
-'**/
+'
+' Returns:
+' String
+'
+' Remarks:
+' Uses API GetTempPathA
+'
'---------------------------------------------------------------------------------------
Public Property Get TempPath() As String
@@ -263,16 +263,19 @@ Public Property Get TempPath() As String
End Property
'---------------------------------------------------------------------------------------
-' Function: TempPath
+' Function: GetNewTempFileName
'---------------------------------------------------------------------------------------
-'/**
-'
-' Generate temp. file name
-'
-' String
-'
-'
-'**/
+'
+' Generate temporary file name
+'
+' Parameters:
+' PathToUse
+' FilePrefix
+' FileExtension
+'
+' Returns:
+' String
+'
'---------------------------------------------------------------------------------------
Public Function GetNewTempFileName(Optional ByVal PathToUse As String = "", _
Optional ByVal FilePrefix As String = "", _
@@ -303,18 +306,20 @@ End Function
'---------------------------------------------------------------------------------------
' Function: ShortenFileName
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Shorten file path to n characters
-'
-' Full path
-' required length
-' String
-'
-' Helpful for the displays in narrow textboxes \n
-' Example: C:\Programms\...\Folder\File.txt
-'
-'**/
+'
+' Parameters:
+' FullFileName - Full path
+' MaxLen - required length
+'
+' Returns:
+' String
+'
+' Remarks:
+' Helpful for the displays in narrow textboxes
+' Example: C:\Programms\...\Folder\File.txt
+'
'---------------------------------------------------------------------------------------
Public Function ShortenFileName(ByVal FullFileName As Variant, ByVal MaxLen As Long) As String
@@ -347,15 +352,15 @@ End Function
'---------------------------------------------------------------------------------------
' Function: FileNameWithoutPath
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Extract file name from complete path specification
-'
-' File name incl. directory
-' String
-'
-'
-'**/
+'
+' Parameters:
+' FullPath">File name incl. directory
+'
+' Returns:
+' String
+'
'---------------------------------------------------------------------------------------
Public Function FileNameWithoutPath(ByVal FullPath As Variant) As String
@@ -375,20 +380,33 @@ End Function
'---------------------------------------------------------------------------------------
' Function: GetDirFromFullFileName
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Determines the directory from the complete path of a file.
-'
-' complete file path
-' String
-'
-'
-'**/
+'
+' Parameters:
+' FullFileName - complete file path
+'
+' Returns:
+' String
+'
'---------------------------------------------------------------------------------------
Public Function GetDirFromFullFileName(ByVal FullFileName As String) As String
GetDirFromFullFileName = PathFromFullFileName(FullFileName)
End Function
+'---------------------------------------------------------------------------------------
+' Function: PathFromFullFileName
+'---------------------------------------------------------------------------------------
+'
+' Extract file path
+'
+' Parameters:
+' FullFileName - complete file path
+'
+' Returns:
+' String
+'
+'---------------------------------------------------------------------------------------
Public Function PathFromFullFileName(ByVal FullFileName As Variant) As String
Dim DirPath As String
@@ -409,15 +427,15 @@ End Function
'---------------------------------------------------------------------------------------
' Function: CreateDirectory
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Creates a directory including all missing parent directories
-'
-' Directory to be created
-' Boolean: True = directory/folder created
-'
-'
-'**/
+'
+' Parameters:
+' FullPath - Directory to be created
+'
+' Returns:
+' Boolean - True = directory/folder created
+'
'---------------------------------------------------------------------------------------
Public Function CreateDirectory(ByVal FullPath As String) As Boolean
@@ -453,15 +471,15 @@ End Sub
'---------------------------------------------------------------------------------------
' Function: FileExists
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Check: file exists
-'
-' Full path specification
-' Boolean
-'
-'
-'**/
+'
+' Parameters:
+' FullPath - Full path specification
+'
+' Returns:
+' Boolean
+'
'---------------------------------------------------------------------------------------
Public Function FileExists(ByVal FullPath As String) As Boolean
@@ -477,15 +495,15 @@ End Function
'---------------------------------------------------------------------------------------
' Function: DirExists
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Check: directory/folder exists
-'
-' Full path specification
-' Boolean
-'
-'
-'**/
+'
+' Parameters:
+' FullPath - Full path specification
+'
+' Returns:
+' Boolean
+'
'---------------------------------------------------------------------------------------
Public Function DirExists(ByVal FullPath As String) As Boolean
@@ -501,16 +519,18 @@ End Function
'---------------------------------------------------------------------------------------
' Function: GetFileUpdateDate
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Last modified date of a file
-'
-' Full path specification
-' Variant
-'
-' Errors from API function are ignored
-'
-'**/
+'
+' Parameters:
+' FullFileName - Full path specification
+'
+' Returns:
+' Variant
+'
+' Remarks:
+' Errors from API function are ignored
+'
'---------------------------------------------------------------------------------------
Public Function GetFileUpdateDate(ByVal FullFileName As String) As Variant
If FileExists(FullFileName) Then
@@ -524,19 +544,21 @@ End Function
'---------------------------------------------------------------------------------------
' Function: ConvertStringToFileName
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Creates a file name from a string (replaces special characters)
-'
-' Initial string for file names
-' Characters as a substitute for special characters
-' Characters that are replaced with ReplaceWith
-' Characters that will be removed
-' String
-'
-' special characters: ? * " / ' : ( )
-'
-'**/
+'
+' Parameters:
+' Text - Initial string for file names
+' ReplaceWith - Characters as a substitute for special characters
+' CharsToReplace - Characters that are replaced with ReplaceWith
+' CharsToDelete - Characters that will be removed
+'
+' Returns:
+' String
+'
+' Remarks:
+' special characters: ? * " / ' : ( )
+'
'---------------------------------------------------------------------------------------
Public Function ConvertStringToFileName(ByVal Text As String, _
Optional ByVal ReplaceWith As String = "_", _
@@ -563,18 +585,19 @@ End Function
'---------------------------------------------------------------------------------------
' Function: GetFullPathFromRelativPath
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Creates a complete path specification from relative path specification and "base directory".
-'
-' relative path
-' Base directory
-' String
-'
+'
+' Parameters:
+' RelativPath">relative path
+' BaseDir">Base directory
+'
+' Returns:
+' String
+'
' Example:
-' GetFullPathFromRelativPath("..\..\Test.txt", "C:\Programms\xxx\") => "C:\test.txt"
-'
-'**/
+' GetFullPathFromRelativPath("..\..\Test.txt", "C:\Programms\xxx\") => "C:\test.txt"
+'
'---------------------------------------------------------------------------------------
Public Function GetFullPathFromRelativPath(ByVal RelativPath As String, _
ByVal BaseDir As String) As String
@@ -619,22 +642,21 @@ End Function
'---------------------------------------------------------------------------------------
' Function: GetRelativPathFromFullPath
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Creates a relative path from the complete path specification and source directory
-'
-' Full path specification
-' Base directory
-' Add ".\" as relative path identifier
-' String
-'
+'
+' Parameters:
+' FullPath - Full path specification
+' BaseDir - Base directory
+' RelativePrefix - Add ".\" as relative path identifier
+'
+' Returns:
+' String
+'
' Example:
-'
-' GetRelativPathFromFullPath("C:\test.txt", "C:\Programms\xxx\", True)
-' => ".\..\..\test.txt"
-'
-'
-'**/
+' GetRelativPathFromFullPath("C:\test.txt", "C:\Programms\xxx\", True)
+' => ".\..\..\test.txt"
+'
'---------------------------------------------------------------------------------------
Public Function GetRelativPathFromFullPath(ByVal FullPath As String, _
ByVal BaseDir As String, _
@@ -712,16 +734,16 @@ End Function
'---------------------------------------------------------------------------------------
' Sub: AddToZipFile
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Add file to Zip file
-'
-' Zip file
-' file to append
-'
-' CreateObject("Shell.Application").Namespace(zipFile & "").CopyHere sFile & ""
-'
-'**/
+'
+' Parameters:
+' ZipFile - Zip file
+' FullFileName - file to append
+'
+' Remarks:
+' CreateObject("Shell.Application").Namespace(zipFile & "").CopyHere sFile & ""
+'
'---------------------------------------------------------------------------------------
Public Sub AddToZipFile(ByVal ZipFile As String, ByVal FullFileName As String)
@@ -738,16 +760,16 @@ End Sub
'---------------------------------------------------------------------------------------
' Function: ExtractFromZipFile
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Extract file from zip file
-'
-' Zip file
-' Destination folder
-' String
-'
-'
-'**/
+'
+' Parameters:
+' ZipFile - Zip file
+' Destination - Destination folder
+'
+' Returns:
+' String
+'
'---------------------------------------------------------------------------------------
Public Function ExtractFromZipFile(ByVal ZipFile As String, ByVal Destination As String) As String
@@ -761,16 +783,16 @@ End Function
'---------------------------------------------------------------------------------------
' Function: CreateZipFile
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Creates an empty zip file
-'
-' Zip file (full path)
-' Delete existing Zip file
-' Boolean
-'
-'
-'**/
+'
+' Parameters:
+' ZipFile - Zip file (full path)
+' DeleteExistingFile - Delete existing Zip file
+'
+' Returns:
+' Boolean
+'
'---------------------------------------------------------------------------------------
Public Function CreateZipFile(ByVal ZipFile As String, Optional ByRef DeleteExistingFile As Boolean = False) As Boolean
@@ -797,16 +819,16 @@ End Function
'---------------------------------------------------------------------------------------
' Function: GetFileExtension
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Returns the file extension of a file returns.
-'
-' File path or file name
-' True: returns extension excl. separator
-' File extension (String)
-'
-'
-'**/
+'
+' Parameters:
+' FilePath - File path or file name
+' WithDotBeforeExtension - True: returns extension excl. separator
+'
+' Returns:
+' String - File extension
+'
'---------------------------------------------------------------------------------------
Public Function GetFileExtension(ByVal FilePath As String, Optional ByVal WithDotBeforeExtension As Boolean = False) As String
GetFileExtension = VBA.Strings.Mid$(FilePath, VBA.Strings.InStrRev(FilePath, ".") + (1 - Abs(WithDotBeforeExtension)))
@@ -816,15 +838,15 @@ End Function
'---------------------------------------------------------------------------------------
' Function: OpenFile
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Open file with API ShellExecute
-'
-' File path or file name
-' Boolean
-'
-'
-'**/
+'
+' Parameters:
+' FileName - File path or file name
+'
+' Returns:
+' Boolean
+'
'---------------------------------------------------------------------------------------
Public Function OpenFile(ByVal FilePath As String, Optional ByVal ReadOnlyMode As Boolean = False) As Boolean
@@ -849,15 +871,15 @@ End Function
'---------------------------------------------------------------------------------------
' Function: OpenFilePath
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Open folder with API ShellExecute
-'
-' folder path or file name
-' Boolean
-'
-'
-'**/
+'
+' Parameters:
+' FilePath - folder path or file name
+'
+' Returns:
+' Boolean
+'
'---------------------------------------------------------------------------------------
Public Function OpenFilePath(ByVal FolderPath As String) As Boolean
diff --git a/source/codelib/localization/L10nDict.cls b/source/codelib/localization/L10nDict.cls
index 311eb9d..9858e10 100644
--- a/source/codelib/localization/L10nDict.cls
+++ b/source/codelib/localization/L10nDict.cls
@@ -7,19 +7,20 @@ Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
-'Attribute VB_PredeclaredId = True
'---------------------------------------------------------------------------------------
-' Klasse: L10nDict
+' Class: localization.L10nDict
'---------------------------------------------------------------------------------------
-'/**
-' \author Josef Poetzl
-'
+'
' Localization dictionary - Auxiliary class for language setting
-'
-' Set attributes VB_PredeclaredId = True so that class can be used without instantiation
-''
-' \ingroup localization
-'**/
+'
+' Author:
+' Josef Poetzl
+'
+' Remarks:
+' Set attributes VB_PredeclaredId = True so that class can be used without instantiation
+'
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
'
' localization/L10nDict.cls
diff --git a/source/codelib/localization/L10nTools.bas b/source/codelib/localization/L10nTools.bas
index 270122f..8c54552 100644
--- a/source/codelib/localization/L10nTools.bas
+++ b/source/codelib/localization/L10nTools.bas
@@ -1,17 +1,18 @@
Attribute VB_Name = "L10nTools"
'---------------------------------------------------------------------------------------
-' Modul: L10nTools
+' Package: localization.L10nTools
'---------------------------------------------------------------------------------------
-'/**
-' \author Josef Pötzl
-'
+'
' Localization (L10n) Functions
-'
-'
-' Use compiler constant L10nMsgBoxReplacement to overwrite MsgBox and InPutBox functions.
-'
-' \ingroup localization
-'**/
+'
+' Author:
+' Josef Pötzl
+'
+' Remarks:
+' Use compiler constant L10nMsgBoxReplacement to overwrite MsgBox and InPutBox functions.
+'
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
'
' localization/L10nTools.bas
diff --git a/source/codelib/misc/QpcStoppuhr.cls b/source/codelib/misc/QpcStopwatch.cls
similarity index 59%
rename from source/codelib/misc/QpcStoppuhr.cls
rename to source/codelib/misc/QpcStopwatch.cls
index c37b173..ea0fafa 100644
--- a/source/codelib/misc/QpcStoppuhr.cls
+++ b/source/codelib/misc/QpcStopwatch.cls
@@ -2,27 +2,28 @@ VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
-Attribute VB_Name = "QpcStoppuhr"
+Attribute VB_Name = "QpcStopwatch"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'---------------------------------------------------------------------------------------
-' Class: QpcStoppuhr
-'---------------------------------------------------------------------------------------
-'/**
-'
-' QueryPerformanceCounter-Stoppuhr
-' zur Zeitmessung
-'
-'
-' Nutzt die API-Funktionen QueryPerformanceCounter und QueryPerformanceFrequency
-' aus Kernel32 zum Messen der Zeit.
-'
-' \ingroup misc
-'**/
+' Class: misc.QpcStopwatch
+'---------------------------------------------------------------------------------------
+'
+' QueryPerformanceCounter stopwatch for time measurement
+'
+' Author:
+' Josef Poetzl
+'
+' Remarks:
+' Uses the API functions QueryPerformanceCounter and QueryPerformanceFrequency from Kernel32 to measure time.
+'
+'---------------------------------------------------------------------------------------
+
+'---------------------------------------------------------------------------------------
'
-' misc/QpcStoppuhr.cls
+' misc/QpcStopwatch.cls
' _codelib/license.bas
'
'---------------------------------------------------------------------------------------
@@ -30,25 +31,20 @@ Attribute VB_Exposed = False
Option Compare Database
Option Explicit
-' Messung mit API
-' QueryPerformanceCounter
-
-
-'temp. Messergebnis
+'temp. measurement result
Private p_TempTime As Currency
Private p_TestFrequ As Currency
-'Zwischenspeicher für Laufzeit
+'Cache for runtime
Private p_Timer As Currency
-'Zeit bei Start
+'Time at start
Private p_Timer_Start As Currency
-'Win-API
+'Win API
Private Declare PtrSafe Function QueryPerformanceCounter Lib "kernel32" (QPC As Currency) As Boolean
Private Declare PtrSafe Function QueryPerformanceFrequency Lib "kernel32" (QPF As Currency) As Boolean
-'Klasse initialisieren
Private Sub Class_Initialize()
p_Timer_Start = 0
p_Timer = 0
@@ -58,13 +54,9 @@ End Sub
'---------------------------------------------------------------------------------------
' Sub: StartT
'---------------------------------------------------------------------------------------
-'/**
-'
-' Stoppuhr starten/neustarten, beginnen mit 0
-'
-'
-'
-'**/
+'
+' Start/restart stopwatch, start with 0
+'
'---------------------------------------------------------------------------------------
Public Sub StartT()
p_Timer = 0
@@ -74,13 +66,9 @@ End Sub
'---------------------------------------------------------------------------------------
' Sub: StopT
'---------------------------------------------------------------------------------------
-'/**
-'
-' Stoppuhr anhalten
-'
-'
-'
-'**/
+'
+' Stop timer
+'
'---------------------------------------------------------------------------------------
Public Sub StopT()
QueryPerformanceCounter p_TempTime
@@ -90,19 +78,14 @@ Public Sub StopT()
End If
End Sub
-
'---------------------------------------------------------------------------------------
-' Sub: RestartT
+' Sub: Restart
'---------------------------------------------------------------------------------------
-'/**
-'
-' Stoppuhr weiterlaufen lassen
-'
-'
-'
-'**/
+'
+' Keep stopwatch running
+'
'---------------------------------------------------------------------------------------
-Public Sub RestartT()
+Public Sub Restart()
'Uhr muss stehen!
QueryPerformanceCounter p_TempTime
If Me.IsRunning = False Then
@@ -111,17 +94,13 @@ Public Sub RestartT()
End Sub
'---------------------------------------------------------------------------------------
-' Sub: ResetT
+' Sub: Reset
'---------------------------------------------------------------------------------------
-'/**
-'
-' Alles auf null
-'
-'
-'
-'**/
+'
+' Everything to zero
+'
'---------------------------------------------------------------------------------------
-Public Sub ResetT()
+Public Sub Reset()
p_Timer_Start = 0
p_Timer = 0
End Sub
@@ -129,70 +108,60 @@ End Sub
'---------------------------------------------------------------------------------------
' Property: IsRunning
'---------------------------------------------------------------------------------------
-'/**
-'
-' Gibt an, ob die Stoppuhr noch läuft
-'
-'
-'
-'**/
+'
+' Indicates whether the stopwatch is still running
+'
'---------------------------------------------------------------------------------------
Public Property Get IsRunning() As Boolean
IsRunning = (p_Timer_Start > 0)
End Property
'---------------------------------------------------------------------------------------
-' Property: Time
+' Property: TimeMSec
'---------------------------------------------------------------------------------------
-'/**
-'
-' Zeit in Millisekunden
-'
-' Currency
-'
-'
-'**/
+'
+' Time in milliseconds
+'
'---------------------------------------------------------------------------------------
-Public Property Get Time() As Currency
+Public Property Get TimeMSec() As Currency
QueryPerformanceCounter p_TempTime
If Me.IsRunning Then
- Time = (p_Timer + p_TempTime - p_Timer_Start) * 1000 / p_TestFrequ ' [ms]
+ TimeMSec = (p_Timer + p_TempTime - p_Timer_Start) * 1000 / p_TestFrequ ' [ms]
Else
- Time = p_Timer * 1000 / p_TestFrequ
+ TimeMSec = p_Timer * 1000 / p_TestFrequ
End If
End Property
'---------------------------------------------------------------------------------------
-' Property: TimeString (2009-12-09)
-'---------------------------------------------------------------------------------------
-'/**
-'
-' Zeit als String mit Formatierung
-'
-' Formatierung der Zeit inkl. Sekunden aber ohne Sekundenbruchteile
-' Anzahl der Stellen für die Millisekunden (nach dem Komma)
-' String
-'
-' Beispiel: TimeString("hh:nn:ss", 5) ergibt "00:05:34,24532"
-'
-'**/
-'---------------------------------------------------------------------------------------
-Public Property Get TimeString(Optional sSecFormatString As String = "hh:nn:ss", _
- Optional iMSecDigits As Long = 3) As String
-
-'sSecFormatString: Format für Uhrzeit ohne Sekundenbruchteile
-'iMSecDigits: Anzahl Stellen nach dem Komma. z.B.: 2 = 1/100-Sek.-Anzeige
+' Function: TimeString
+'---------------------------------------------------------------------------------------
+'
+' Time as string with formatting
+'
+' Parameters:
+' FormatString - Formatting of time incl. seconds but without fractions of seconds
+' SecDigits - Number of digits for the fractions of a second (after the decimal point)
+'
+' Returns:
+' String
+'
+' Example:
+' TimeString("hh:nn:ss", 5) return formatted string like "00:05:34,24532"
+'
+'---------------------------------------------------------------------------------------
+Public Function TimeString(Optional FormatString As String = "hh:nn:ss", _
+ Optional SecDigits As Long = 3) As String
- Dim curTimeSec As Currency
- Dim strTimeString As String
+ Dim TimeSec As Currency
+ Dim FormattedTime As String
- curTimeSec = VBA.Round(Me.Time / 1000, iMSecDigits) 'mathematisches Runden ist ok
+ TimeSec = VBA.Round(Me.TimeMSec / 1000, SecDigits)
- strTimeString = Format(TimeSerial(0, 0, Fix(curTimeSec)), sSecFormatString)
- If iMSecDigits > 0 Then
- strTimeString = strTimeString & Format(curTimeSec - Fix(curTimeSec), "." & String(iMSecDigits, "0"))
+ FormattedTime = Format(TimeSerial(0, 0, Fix(TimeSec)), FormatString)
+ If SecDigits > 0 Then
+ FormattedTime = FormattedTime & Format(TimeSec - Fix(TimeSec), "." & String(SecDigits, "0"))
End If
- TimeString = strTimeString
+ TimeString = FormattedTime
-End Property
+End Function
diff --git a/source/codelib/text/StringTools.bas b/source/codelib/text/StringTools.bas
index 054f43e..a529e24 100644
--- a/source/codelib/text/StringTools.bas
+++ b/source/codelib/text/StringTools.bas
@@ -1,16 +1,16 @@
Attribute VB_Name = "StringTools"
Attribute VB_Description = "String-Hilfsfunktionen"
'---------------------------------------------------------------------------------------
-' Modul: StringTools
+' Modul: text.StringTools
'---------------------------------------------------------------------------------------
-'/**
-'
-' Text-Hilfsfunktionen
-'
-'
'
-' \ingroup text
-'**/
+' Text functions
+'
+' Author:
+' Josef Poetzl, Sten Schmidt
+'
+'---------------------------------------------------------------------------------------
+
'---------------------------------------------------------------------------------------
'
' text/StringTools.bas
@@ -26,16 +26,13 @@ Option Private Module
'---------------------------------------------------------------------------------------
' Enum: TrimOption
'---------------------------------------------------------------------------------------
-'/** '<-- Start Doxygen-Block
-'
-' Verfügbare Trim-Optionen für die Trim-Funktion
-'
-'
-' TrimStart (1)Führende Leerzeichen aus einer Zeichenfolgenvariablen entfernen
-' TrimEnd (2)Nachgestellte Leerzeichen aus einer Zeichenfolgenvariablen entfernen
-' TrimBoth (3)Führende und nachgestellte Leerzeichen entfernen
-'
-'**/ '<-- Ende Doxygen-Block
+'
+' Available trim options for the trim function
+'
+' TrimStart - (1) Remove leading spaces from a string variable
+' TrimEnd - (2) Remove trailing spaces from a string variable
+' TrimBoth - (3) Remove leading and trailing spaces
+'
'---------------------------------------------------------------------------------------
Public Enum TrimOption
TrimStart = 1
@@ -46,15 +43,16 @@ End Enum
'---------------------------------------------------------------------------------------
' Function: IsNullOrEmpty
'---------------------------------------------------------------------------------------
-'/**
-'
-' Gibt an, ob der übergebene Wert Null oder eine leere Zeichenfolge ist.
-'
-' Zu prüfender Wert
-' Leerzeichen am Anfang u. Ende ignorieren
-' Boolean
-'
-'**/
+'
+' Specifies whether the passed value is null or an empty string
+'
+' Parameters:
+' ValueToTest - Value to be checked
+' IgnoreSpaces - Ignore spaces at the beginning and end
+'
+' Returns:
+' Boolean
+'
'---------------------------------------------------------------------------------------
Public Function IsNullOrEmpty(ByVal ValueToTest As Variant, Optional ByVal IgnoreSpaces As Boolean = False) As Boolean
@@ -78,15 +76,16 @@ End Function
'---------------------------------------------------------------------------------------
' Function: FormatText
'---------------------------------------------------------------------------------------
-'/**
-'
-' Fügt in den Platzhalter des Formattextes die übergebenen Parameter ein
-'
-' Textformat mit Platzhalter ... Beispiel: "XYZ{0}, {1}"
-' übergabeparameter in passender Reihenfolge
-' String
-'
-'**/
+'
+' Inserts the passed parameters into the placeholder {0..n} of the format text
+'
+' Parameters:
+' FormatString - Text format with placeholder ... Example: "XYZ{0}, {1}"
+' Args - Passing parameters in suitable order
+'
+' Returns:
+' String
+'
'---------------------------------------------------------------------------------------
Public Function FormatText(ByVal FormatString As String, ParamArray Args() As Variant) As String
@@ -111,19 +110,19 @@ End Function
'---------------------------------------------------------------------------------------
' Function: Format
'---------------------------------------------------------------------------------------
-'/**
-'
-' Ersetzt die VBA-Formatfunktion
-' Erweiterung: [h] bzw. [hh] für Stundenanzeige über 24
-'
-'
-' Ein gültiger benannter oder benutzerdefinierter Formatausdruck inkl. Erweiterung für Stundenanzeige über 24 (Standard-Formatanweisungen siehe VBA.Format)
-' Wird an VBA.Format weitergereicht
-' Wird an VBA.Format weitergereicht
-' String
-'
-'
-'**/
+'
+' Replaces the VBA format function
+' Extension: [h] or [hh] for hour display over 24
+'
+' Parameters:
+' Expression - The value to format
+' FormatString - A valid named or user-defined format expression incl. extension for hours display over 24 (for standard format instructions see VBA.Format)
+' FirstDayOfWeek - Passed on to VBA.Format
+' FirstWeekOfYear - Passed on to VBA.Format
+'
+' Returns:
+' String
+'
'---------------------------------------------------------------------------------------
Public Function Format(ByVal Expression As Variant, Optional ByVal FormatString As Variant, _
Optional ByVal FirstDayOfWeek As VbDayOfWeek = vbSunday, _
@@ -159,18 +158,20 @@ End Function
'---------------------------------------------------------------------------------------
' Function: PadLeft
'---------------------------------------------------------------------------------------
-'/**
-'
-' Linksbündiges Auffüllen eines Strings
-'
-' String der augefüllt werden soll
-' Gesamtlänge der resultierenen Zeichenfolge
-' Zeichen mit dem aufgefüllt werden soll
-' String
-'
-' Wenn die Länge von value größer oder gleich totalWidth ist, wird das Resultat auf totalWidth Zeichen begrenzt
-'
-'**/
+'
+' Left padding of a string
+'
+' Parameters:
+' Value - String to be filled in
+' TotalWidth - Total length of the resulting string
+' PadChar - (optional) Character to be padded with; Default: " "
+'
+' Returns:
+' String
+'
+' Remarks:
+' If the length of value is greater than or equal to totalWidth, the result is limited to totalWidth characters
+'
'---------------------------------------------------------------------------------------
Public Function PadLeft(ByVal Value As String, ByVal TotalWidth As Integer, Optional ByVal PadChar As String = " ") As String
PadLeft = VBA.Right$(VBA.String$(TotalWidth, PadChar) & Value, TotalWidth)
@@ -179,18 +180,20 @@ End Function
'---------------------------------------------------------------------------------------
' Function: PadRight
'---------------------------------------------------------------------------------------
-'/**
-'
-' Rechtsbündiges Auffüllen eines Strings
-'
-' String der augefüllt werden soll
-' Gesamtlänge der resultierenen Zeichenfolge
-' Zeichen mit dem aufgefüllt werden soll
-' String
-'
-' Wenn die Länge von Value größer oder gleich totalWidth ist, wird das Resultat auf TotalWidth Zeichen begrenzt
-'
-'**/
+'
+' Right padding of a string
+'
+' Parameters:
+' Value - String to be filled in
+' TotalWidth - Total length of the resulting string
+' PadChar - (optional) Character to be padded with; Default: " "
+'
+' Returns:
+' String
+'
+' Remarks:
+' If the length of value is greater than or equal to totalWidth, the result is limited to totalWidth characters
+'
'---------------------------------------------------------------------------------------
Public Function PadRight(ByVal Value As String, ByVal TotalWidth As Integer, Optional ByVal PadChar As String = " ") As String
PadRight = VBA.Left$(Value & VBA.String$(TotalWidth, PadChar), TotalWidth)
@@ -199,17 +202,19 @@ End Function
'---------------------------------------------------------------------------------------
' Function: Contains
'---------------------------------------------------------------------------------------
-'/**
-'
-' Gibt an ob searchValue in der Zeichenfolge checkValue vorkommt.
-'
-' Zeichenfolge die durchsucht werden soll
-' Zeichenfolge nach der gesucht werden soll
-' Boolean
-'
-' Ergibt True, wenn searchValue in checkValue enthalten ist oder searchValue den Wert vbNullString hat
-'
-'**/
+'
+' Indicates whether SearchValue occurs in the CheckValue string
+'
+' Parameters:
+' CheckValue - String to be searched
+' SearchValue - String to be searched for
+'
+' Returns:
+' Boolean
+'
+' Remarks:
+' Returns True if SearchValue is contained in CheckValue or SearchValue has the value vbNullString
+'
'---------------------------------------------------------------------------------------
Public Function Contains(ByVal CheckValue As String, ByVal SearchValue As String) As Boolean
Contains = VBA.InStr(1, CheckValue, SearchValue, vbTextCompare) > 0
@@ -218,16 +223,16 @@ End Function
'---------------------------------------------------------------------------------------
' Function: EndsWith
'---------------------------------------------------------------------------------------
-'/**
-'
-' Gibt an ob die Zeichenfolge CheckValue mit SearchValue endet.
-'
-' Zeichenfolge die durchsucht werden soll
-' Zeichenfolge nach der gesucht werden soll
-' Boolean
-'
-'
-'**/
+'
+' Indicates whether the string CheckValue ends with SearchValue
+'
+' Parameters:
+' CheckValue - String to be searched
+' SearchValue - String to be searched for
+'
+' Returns:
+' Boolean
+'
'---------------------------------------------------------------------------------------
Public Function EndsWith(ByVal CheckValue As String, ByVal SearchValue As String) As Boolean
EndsWith = VBA.Right$(CheckValue, VBA.Len(SearchValue)) = SearchValue
@@ -236,16 +241,16 @@ End Function
'---------------------------------------------------------------------------------------
' Function: StartsWith
'---------------------------------------------------------------------------------------
-'/**
-'
-' Gibt an ob die Zeichenfolge CheckValue mit SearchValue beginnt.
-'
-' Zeichenfolge die durchsucht werden soll
-' Zeichenfolge nach der gesucht werden soll
-' Boolean
-'
-'
-'**/
+'
+' Indicates whether the string CheckValue starts with SearchValue
+'
+' Parameters:
+' CheckValue - String to be searched
+' SearchValue - String to be searched for
+'
+' Returns:
+' Boolean
+'
'---------------------------------------------------------------------------------------
Public Function StartsWith(ByVal CheckValue As String, ByVal SearchValue As String) As Boolean
StartsWith = VBA.Left$(CheckValue, VBA.Len(SearchValue)) = SearchValue
@@ -254,14 +259,15 @@ End Function
'---------------------------------------------------------------------------------------
' Function: Length
'---------------------------------------------------------------------------------------
-'/**
-'
-' Gibt die Anzahl von Zeichen in Value zurück
-'
-' Anzahl Zeichen von Value als Long
-'
-'
-'**/
+'
+' Returns the number of characters in Value
+'
+' Parameters:
+' Value - String to be checked
+'
+' Returns:
+' Long - Anzahl Zeichen von Value
+'
'---------------------------------------------------------------------------------------
Public Function Length(ByVal Value As String) As Long
Length = VBA.Len(Value)
@@ -270,16 +276,16 @@ End Function
'---------------------------------------------------------------------------------------
' Function: Concat
'---------------------------------------------------------------------------------------
-'/**
-'
-' Fügt der Zeichenfolge ValueA die Zeihenfolge ValueB an.
-'
-' Zeichenfolge
-' Zeichenfolge
-' ValueB angefügt an ValueA als String
-'
-'
-'**/
+'
+' Appends the string ValueB to the string ValueA.
+'
+' Parameters:
+' ValueA - Base string
+' ValueB - String to be append at end of A
+'
+' Returns:
+' String - ValueB appended to ValueA
+'
'---------------------------------------------------------------------------------------
Public Function Concat(ByVal ValueA As String, ByVal ValueB As String) As String
Concat = ValueA & ValueB
@@ -288,17 +294,18 @@ End Function
'---------------------------------------------------------------------------------------
' Function: Trim
'---------------------------------------------------------------------------------------
-'/**
-'
-' Entfernt führende und/oder nachfolgende Leerzeichen einer Zeichenfolge.
-' Ersetzt die Funktion VBA.Trim().
-'
-' Zeichenfolge
-' Trim-Optionen
-' String
-'
-'
-'**/
+'
+' Removes leading and/or trailing spaces from a string
+'
+' Replaces the function VBA.Trim().
+'
+' Parameters:
+' Value - String to be trimmed
+' TrimType - Trim options (at start, at end or both)
+'
+' Returns:
+' String
+'
'---------------------------------------------------------------------------------------
Public Function Trim(ByVal Value As String, Optional ByVal TrimType As TrimOption = TrimOption.TrimBoth) As String
@@ -322,19 +329,20 @@ End Function
'---------------------------------------------------------------------------------------
' Function: Substring
'---------------------------------------------------------------------------------------
-'/**
-'
-' Gibt einen Teil der Zeichenfolge Value zurück, die an der Position StartIndex beginnt
-' und die Länge Length hat.
-'
-' Zeichenfolge
-' Startposition in der Zeichenfolge
-' Anzahl Zeichen die Zurückgegeben werden sollen
-' String
-'
-' StartIndex ist Nullterminiert, analog zu String.Substring() in .NET
-'
-'**/
+'
+' Returns a part of the string Value starting at the position StartIndex and having the length Length.
+'
+' Parameters:
+' Value - String
+' StartIndex - Start position in the string
+' Length - Number of characters to be returned
+'
+' Returns:
+' String
+'
+' Remarks:
+' StartIndex is null terminated, analogous to String.Substring() in .NET
+'
'---------------------------------------------------------------------------------------
Public Function SubString(ByVal Value As String, ByVal StartIndex As Long, Optional ByVal Length As Long = 0) As String
If Length = 0 Then Length = StringTools.Length(Value) - StartIndex
@@ -344,17 +352,17 @@ End Function
'---------------------------------------------------------------------------------------
' Function: InsertAt
'---------------------------------------------------------------------------------------
-'/**
-'
+'
' Setzt die Zeichenfolge InsertValue an der Position Pos ein
-'
-' Zeichenfolge
-' Zeichenfolge die eingefügt werden soll
-' Position an der die Zeichenfolge eingefügt werden soll (Pos ist nullterminiert)
-' String
-'
-'
-'**/
+'
+' Parameters:
+' Value - String
+' InsertValue - String to be inserted
+' Pos - Position at which the string is to be inserted (Pos is zero-terminated).
+'
+' Returns:
+' String
+'
'---------------------------------------------------------------------------------------
Public Function InsertAt(ByVal Value As String, ByVal InsertValue As String, ByVal Pos As Long) As String
InsertAt = VBA.Mid$(Value, 1, Pos) & InsertValue & StringTools.SubString(Value, Pos)
@@ -363,17 +371,19 @@ End Function
'---------------------------------------------------------------------------------------
' Function: Replicate
'---------------------------------------------------------------------------------------
-'/**
-'
-' Zeichenfolge wiederholen
-'
-' Die zu wiederholende Zeichenfolge
-' Anzahl der Wiederholungen
-' String
-'
-' Replicate("abc", 3) erzeugt "abcabcabc"
-'
-'**/
+'
+' Repeat string
+'
+' Parameters:
+' Value - The string to be repeated
+' Number - Number of repetitions
+'
+' Returns:
+' String
+'
+' Remarks:
+' Replicate("abc", 3) creates "abcabcabc"
+'
'---------------------------------------------------------------------------------------
Public Function Replicate(ByVal Value As String, ByVal Number As Long) As String
diff --git a/source/codelib/user/login/LoginForm.frm b/source/codelib/user/login/LoginForm.frm
index 543632e..e91765e 100644
Binary files a/source/codelib/user/login/LoginForm.frm and b/source/codelib/user/login/LoginForm.frm differ
diff --git a/source/codelib/vba/ErrorTrappingObserver.cls b/source/codelib/vba/ErrorTrappingObserver.cls
new file mode 100644
index 0000000..c95f5f8
--- /dev/null
+++ b/source/codelib/vba/ErrorTrappingObserver.cls
@@ -0,0 +1,72 @@
+VERSION 1.0 CLASS
+BEGIN
+ MultiUse = -1 'True
+END
+Attribute VB_Name = "ErrorTrappingObserver"
+Attribute VB_GlobalNameSpace = False
+Attribute VB_Creatable = False
+Attribute VB_PredeclaredId = False
+Attribute VB_Exposed = False
+'---------------------------------------------------------------------------------------
+' Class: vba.ErrorTrappingObserver
+'---------------------------------------------------------------------------------------
+'
+' Auxiliary class for error trapping manipulation
+'
+' Author:
+' Josef Poetzl
+'
+'---------------------------------------------------------------------------------------
+
+'---------------------------------------------------------------------------------------
+'
+' vba/ErrorTrappingObserver.cls
+'
+'---------------------------------------------------------------------------------------
+Option Compare Database
+Option Explicit
+
+Private Const ErrorTrappingOptionName As String = "Error Trapping"
+
+Public Enum ErrorTrappingOptions
+ BreakOnAllErrors = 0
+ BreakInClassModule = 1
+ BreakOnUnhandledErrors = 2
+End Enum
+
+Private m_InitialErrorTrapping As ErrorTrappingOptions
+Private m_KeepNewValueOnTerminate As Boolean
+
+Private Sub Class_Initialize()
+ m_InitialErrorTrapping = Application.GetOption(ErrorTrappingOptionName)
+End Sub
+
+Private Sub Class_Terminate()
+ If Not m_KeepNewValueOnTerminate Then
+ RestoreErrorTrapping
+ End If
+End Sub
+
+Public Property Get KeepNewValueOnTerminate() As Boolean
+ KeepNewValueOnTerminate = m_KeepNewValueOnTerminate
+End Property
+
+Public Property Let KeepNewValueOnTerminate(ByVal NewValue As Boolean)
+ m_KeepNewValueOnTerminate = NewValue
+End Property
+
+Public Property Get ErrorTrapping() As ErrorTrappingOptions
+ ErrorTrapping = Application.GetOption(ErrorTrappingOptionName)
+End Property
+
+Public Property Let ErrorTrapping(ByVal NewValue As ErrorTrappingOptions)
+ If ErrorTrapping <> NewValue Then
+ Application.SetOption ErrorTrappingOptionName, NewValue
+ End If
+End Property
+
+Private Sub RestoreErrorTrapping()
+ If m_InitialErrorTrapping <> ErrorTrapping Then
+ Application.SetOption ErrorTrappingOptionName, m_InitialErrorTrapping
+ End If
+End Sub
diff --git a/source/modAccessFunctions.bas b/source/modAccessFunctions.bas
index 7808773..70be910 100644
--- a/source/modAccessFunctions.bas
+++ b/source/modAccessFunctions.bas
@@ -1,15 +1,13 @@
Attribute VB_Name = "modAccessFunctions"
'---------------------------------------------------------------------------------------
-' Modul: modAccessFunctionReDefine
+' Package: modAccessFunctionReDefine
'---------------------------------------------------------------------------------------
-'/* *
-'
+'
' Replacements of Access/VBA functions
-'
-'
-' Simplifies programming by specifying procedure parameters, etc.
-'
-'* */
+'
+' Remarks:
+' Simplifies programming by specifying procedure parameters, etc.
+'
'---------------------------------------------------------------------------------------
'
Option Compare Text
@@ -25,7 +23,7 @@ Public Function MsgBox(ByVal Prompt As Variant, _
Dim strTitle As String
If IsMissing(Title) Then
- Title = CurrentApplicationName
+ Title = CurrentApplication.ApplicationName
End If
MsgBox = L10n.MsgBox(Prompt, Buttons, Title, HelpFile, Context)
@@ -42,7 +40,7 @@ Public Function InputBox(ByVal Prompt As Variant, _
Dim strTitle As String
If IsMissing(Title) Then
- Title = CurrentApplicationName
+ Title = CurrentApplication.ApplicationName
End If
InputBox = L10n.InputBox(Prompt, Title, Default, XPos, YPos, HelpFile, Context)
diff --git a/source/modAddIn_Files.bas b/source/modAddIn_Files.bas
index 2be14f9..ebb5ee4 100644
--- a/source/modAddIn_Files.bas
+++ b/source/modAddIn_Files.bas
@@ -18,7 +18,6 @@ Private Declare PtrSafe Function GetTempPath Lib "kernel32" Alias "GetTempPathA"
Private Const m_conMaxPathLen As Long = 255
Private Sub dateienEinstellen()
- Call SaveAppFile("ChmFile", CodeProject.Path & "\doxygen\html\DbmsConnectionWizard.chm", True)
SaveModulesInTable
End Sub
@@ -57,7 +56,7 @@ Public Property Get AddInHelpFile() As String
End Property
Public Sub OpenHelpFile(Optional ByVal ContextID As Long = 0)
-
+' @todo: create new help file
If ContextID = 0 Then
ShellExecuteOpenFile AddInHelpFile
Else