New Features and Bug Fixes in Version 4.51 of ODBCExpress
=========================================================
New Features
------------
New features introduced since ODBCExpress 4.5:
1. The code for positional insert, update and delete operations has been
re-visited and the following major changes have been made:
- Level 1 SQL Generation now supports the positional updating of blob fields
as well. This means you don't have to set the target table, primary
columns and ignore columns if you're using level 1 SQL Generation together
with blob fields.
- This corrects item 3 under the "MS SQL Server" heading in the Drivers.TXT
file (level 1 SQL Generation now works fine with MS SQL Server).
- It also corrects item 6 under the "MS Access" heading in the Drivers.TXT
file (level 2 SQL Generation now works fine with Access), as well as
item 8 (level 1 SQL Generation does not give a "database in use" error
anymore when using blob fields, since blobs aren't separately updated
anymore).
- Target table detection is extended to work even if the ODBC driver is not
able to return the target table (the SQL is parsed to return this
information if necessary). This means that it won't be necessary to
manually set the TargetTable property for any level of SQL Generation
which requires this (though the option still exists).
- Primary key detection has been added, which means that it won't be
necessary to manually set this information for any level of SQL Generation
which requires this. This will of course only work if the target table in
the database is set up with a primary key. If not, this information can
still be set manually. For level 2 and 3 SQL Generation the columns which
can't be updated must still manually be set to be ignored, if any.
2. A TCustomOEDataSet component has been added between the virtual TDataSet and
the TOEDataSet. This component does not publish any properties. The
TOEDataSet's only function is to publish all the necessary TDataSet and
TCustomOEDataSet properties.
3. From the TCustomOEDataSet a new component TCustomOEQuery is derived, which
adds a TStrings SQL property, as well as the TableName, RequestLive and
UniDirectional properties to the TCustomOEDataSet. This component replaces
the TSQLDataSet component. Because of the full level 1 SQL Generation
support in this version of ODBCExpress, the RequestLive property sets the
Hstmt.ConcurrencyType sub-property to SQL_CONCUR_LOCK if True and to
SQL_CONCUR_READ_ONLY if False. The UniDirectional property sets the
Hstmt.CursorType sub-property to SQL_CURSOR_FORWARD_ONLY if True and to
SQL_CURSOR_KEYSET_DRIVEN if False (the best performing, guaranteed
bookmarked cursor). This allows the TOEQuery component derived from the
unpublished TCustomOEQuery component to hide all the non-TQuery-like
properties of the TCustomOEDataSet, thereby providing a component which will
be very familiar to the BDE TQuery users. This component will ease the
migration to ODBCExpress and help to easily convert existing projects.
4. Two TOEUpdateObject components TOEUpdateSQL and TOEUpdateProc have been
added. The TOEUpdateSQL component is very similar to the BDE TUpdateSQL
component and provides a new way of implementing level 4 SQL Generation.
This component will also contribute to ease the migration process. The
SQL Builder is also extended to generate named parameters and underlying
parameters prefixed with "OLD_" for the insert, update and delete SQL.
Similarly the TOEUpdateProc component supports these operations via stored
procedures at the database. These two new components allows you to
implement only some of the positional operations if needed, leaving the
other positional operations to be performed by other levels of
SQL Generation.
5. The LocateInsert functionality of the TCustomOEDataSet (which depends on
primary key information to position to the inserted record) now also detects
the primary key information if necessary, so there is no need to set this
information if the tables are set up with primary keys.
6. The TCustomOEDataSet.TTarget property editor can now automatically detect
primary and ignore columns in addition to the target table.
7. Two string list properties PrimaryColNames and IgnoreColNames have been
added to the TCustomOEDataSet.TTarget property. This allows you to read the
existing primary and ignore columns, as well as add or remove individual
columns to these two lists. The PrimaryColNames.Clear and
IgnoreColNames.Clear methods replace the ClearPrimaryCols and
ClearIgnoreCols methods respectively.
8. Connection Pooling control has been extended by providing four options
instead of just "on" and "off":
- cpOff: Sets connection pooling off.
- cpOnePerEnv: Sets one connection pool per ODBC environment.
- cpOnePerDriver: Sets one connection pool per ODBC driver.
- cpDefault: Allows connection pooling to be controlled externally. This
option is useful when using ODBCExpress in an environment which controls
connection pooling externally (e.g. in a MS Transaction Server
environment). This is the default option.
The True and False values in ODBCExpress 4.5 is automatically converted to
cpOnePerDriver and cpOff respectively, which is what the True and False
values indicated.
9. An EmptyStringToNull property has been added to the THstmt and
TCustomOEDataSet components to control the way empty strings are interpreted
by ODBCExpress. Three options are provided:
- enNever: Empty strings are never converted to null values in the
database, in other words a distinction is made between empty and null
strings, as is currently the case in ODBCExpress. This is the default
option.
- enAlways: Empty strings are always converted to null values in the
database.
- enIfNeeded: Empty strings are only converted to null values in the
database if ODBCExpress detects that the columns in question are nullable.
10. ColVariant, CellVariant, ColOleVariant and CellOleVariant methods have been
added to the THstmt component to allow you to easily read or set column
values as Variants or OleVariants.
11. The TOEParams and TOEParam classes can now be created and maintained
independently of a TCustomOEDataSet or descendant. The TOEParams class can
be created using a normal TOEParams.Create statement, the TOEParam class can
be created via the TOEParams.CreateParam method, and the TOEParams class can
be assigned to a TCustomOEDataSet or descendant by assigning it to the
TCustomOEDataSet.Params property.
12. The RowCount properties will always fall back to manually counting the rows
while retrieving them if it cannot determine the count directly from the
ODBC driver or by doing a "SELECT Count(*)" from the database.
13. The THstmt contained by the TCustomOEDataSet can now be created via a
protected virtual method CreateHstmt, which you can override and return a
customized THstmt descendant component from, without calling the inherited
method which creates an original THstmt component by default. A protected
MainHstmt property has also been added to the TCustomOEDataSet component to
provide easy access in descendant TCustomOEDataSet components to the THstmt
component contained by the TCustomOEDataSet.
14. An OnPrepare event is added to the THstmt in addition to the OnExecute and
OnFetch events.
Bug Fixes
---------
The following bugs, which existed in ODBCExpress 4.5, are now fixed in
ODBCExpress 4.51:
1. The following Lookup and Calculated field problems are fixed:
- The field display wasn't immediately updated when a new lookup value was
selected, but only after you moved off the control containing the lookup
field.
- The Locate method did not check for null or empty variants, causing
variant conversion problems when all the fields used by a lookup or
calculated field weren't filled.
- A bug in the TOEDataSet buffer copying method overriding bookmark memory
became apparent when using lookup or calculated fields, causing access
violations.
2. The TOEDataSet parameter editor did not work for stored procedures if the
Hdbc property was not set or the stored procedure not found at the database.
3. When a TOEDataSet parameter was cleared (set to null), the parameter was not
bound to a null value.
4. The Modified property of the TOEDataSet was not set if blob fields were
modified.
5. The LocateInsert functionality of the TOEDataSet sometimes incorrectly fired
when updates were done, causing the dataset cursor to be re-positioned to
the first row.
6. The TField.OldValue values weren't set when deletes were done with the
TOEDataSet.
7. The inherited DoExit call in the virtual TIntFloatEdit's DoExit method was
left out and therefore the OnExit event did not fire.
Comments
--------
Some important comments on the new version:
1. Please report any problems experienced with this new version to
support@odbcexpress.com so that it can be addressed as soon as possible.
2. For the TOEAdministrator.RemoveDataSource method to work correctly you have
to specify via the DataSourceType property whether it is the default
DataSource (dsDefault), a user DataSource (dsUser) or a system DataSource
(dsSystem) that you want to remove. If the DataSourceType property is left
at its default value (dsDefault), you won't be able to delete a user
DataSource by default, as was the case in pre-version 4.5 versions of
ODBCExpress.
Acknowledgements
----------------
Thanks to everybody for all the suggestions and feedback which were instrumental
in the development of this new version of ODBCExpress.