New FTDN June/Junio 2013 (FWH 13.06)
Posted: Mon Jul 08, 2013 6:53 pm
June 2013
=========
* New: Method Set( cItem ) CLASS TDbCombo, now initializes properly the shown item:
http://forums.fivetechsupport.com/viewt ... 08#p146508
* Fix: There was a bug in Class TMsgItem Method Refresh() that caused a resources
leak. Now it is ok:
http://forums.fivetechsupport.com/viewt ... 54#p146554
* Fix: Recent Class TDbCombo Method Set( cItem ) was not considering not string
values. Now it is ok:
http://forums.fivetechsupport.com/viewt ... 71#p146671
* New: XBrowse new DATA bDelete and new Method Delete()
oBrw:Delete() evaluates oBrw:bDelete if assigned and refreshes the browse.
SetRDD(), SetADO, SetOdbf, SetArray and SetTDolphin assign default bDelete codeblocks.
So, by default oBrw:Delete() deletes the current row and refreshes the browse for RDD, ADO
Array, TDataBase and TDolphin.
* Fix: XBrowse SetADO(). Even for numeric columns with more than 2 decimal places, xbrowse
was limiting the decimal places to 2 only. Fixed now.
* Fix: TDatabase class: Method Save() was not calling method Load() after successful save,
resulting in misleading result by method Updated(). Fixed now.
* DataRow.prg improved. Method Edit() uses suitable picture clause for numeric values.
DataRow created from XBrowse can handle edits and appends
* New: TDataRow class: New Methods
SetPrompt( cFieldName, cPrompt )
or
SetPrompt( { { cFieldName1, cPrompt1 }, ... { cFieldNameN, cPromptN } } )
Enbales seetting an alternative name to a field to be used as prompt
Example: oRec:SetPrompt( "first", "First Name" )
oRec:EditMethod uses the prompt to display name of field
Value of the field can be accesssed either as oRec:First or oRec:FirstName
Query prompt of field by oRec:FieldPrompt( 1 ) or oRec:FieldPrompt( "first" ) --> "First Name"
* Enhancement: FW_ShowAdoError( oCn, [lSilent := .f.] ) now returns the ado error object. New second parameter
if set to .t., suppresses display of message but returns the error object. When error is displayed line
number and process name also is displayed.
* The two new commands DBG and LOG introduced in FWH 13.05 are renamed as FWDBG and FWLOG to avoid conflicts with
names used in application programs
* XBrowse ADO: Improved handling of multi-user editing conflicts.
* Enhancement: FW_CreateMDB( cMdbOrAccDb, [ cPassWord ] ) now accepts optional password as second paramter.
If specified the MDB/ACCDB is created with the password.
* New sample: AdoXbr01.prg in fwh\samples folder. For beginners, demonstrates creation of access database,
creation of table, copy from dbf and xbrowse with Add, Edit and Delete.
In particular demonstrates the simplest way of using AddNew(), Update() and GetRows() methods of ADO
* XBrowse: In the method SetRDD(), bSeek codeblock is created only if the programmer did not already
specified bSeek codeblock before calling SetRdd. This is to provide backward compatibility with some
legacy software where SetRDD is never called in the program
* New ADO Functions:
1) FW_CreateAdoTableSQL( cTable, aCols, [oCn], [lAddAutoInc] ) --> cSql
This function returns cSql that can be used for creation of the table by oCn:Execute( cSql )
The programmers can examine the Sql statement, make alternations if neeeded and then create the table.
aCols is an array same as DbStruct() of DBF. Appropriate column types are chosen by the function
suitable to the RDBMS used by the oCn ( connection object ).
Memo fields are considered as text only fields and suitable field type is selected by the function.
If field is to be created to hold binary data like photos, etc., filed type "M" may be changed to
"m" before calling the function.
Notes: oCn defaults to previously used connection and lAddAutoInc defaults to .t.
2) FW_CreateAdoTable( cTable, aCols, [oCn], [lAddAutoInc] ) --> lSuccess
This function uses the first function to generate sql statement and uses it to create the table.
The table is created only if the tables does not already exist.
3) FW_AdoImportFromDBF( oCn, cDbfFile, [cAdoTable], [cColPrefix], [nMultiRowSize], [acFields] )
This function creates a Table in the sql database, based on the structure of the Dbf file and also
copies data from the dbf into the sql table, all in one go.
Parameters:
1. oCn : Connection Object. If instead a connection string/ spec is specified, the connection is
opened and closed after importing the DBF.
2. cDbfFile: Dbf file name from which data is to imported. If the file is not found or can not be
opened, the function aborts with a message.
3. cAdoTableName [Optional]. By default the DBF file name is used.
4. cColPrefix: [Optinal]. The function allows creation of field names which may confilct with reserved
words. This is done by escaping the column names suitable to the RDBMS.
However it is not desirable to have column names which conflict with reserved words. To guard
against this, the programmer may specify a string to be prefixed to each column name.
Example: If cColPrefix is specified as "C_", then each column created is "C_" + field name in DBF.
5. nMultiRowSize [Optional: Default 20]: This function used SQL "INSERT" statements to speed up import
instead of ADO's AddNew(). Though MSACCESS allows only single row inserts, most other RDBMS permit
multi-row inserts. By default for RDBMS other than MSACCESS, the function prepares one SQL statement
for 20 rows and inserts 20 rows at a time. The programmer can specify a different number instead of
the default 20. Multi-row inserts are faster than single row inserts.
6. caFields: [Optional]. The programmer can specify a comma delimited list of fields to be imported.
Eg. "FIRST,STREET,CITY,SALARY". Or the programmer can specify an limited part of the dbstruct() array
containing only the fields to be imported. The array should be of the same structure as a dbstruct() array.
4) FW_AdoTableExists( cTable, [oCn] ) --> lExists
5) FW_AdoTables( [oCn] ) --> aTables
* Fix: Class TRBtn Method ShowPopup() was not properly working when invoked from a RibbonBar button
action. Now it is ok:
http://forums.fivetechsupport.com/viewt ... 82#p147882
* Fix: MsgDate() is entering into infinite loop when the first parameter dDate is an empty date.
Now fixed.
http://forums.fivetechsupport.com/viewt ... =6&t=26699
* XBrowse and TDataRow for ADO: Assignment of Empty Date Value to a Date/DateTime field
of Non-Jet (other than Access) in Harbour results in runtime error. There is no such
problem with xHarbour. Implemented a work around for Harbour till the issue is resolved.
=========
* New: Method Set( cItem ) CLASS TDbCombo, now initializes properly the shown item:
http://forums.fivetechsupport.com/viewt ... 08#p146508
* Fix: There was a bug in Class TMsgItem Method Refresh() that caused a resources
leak. Now it is ok:
http://forums.fivetechsupport.com/viewt ... 54#p146554
* Fix: Recent Class TDbCombo Method Set( cItem ) was not considering not string
values. Now it is ok:
http://forums.fivetechsupport.com/viewt ... 71#p146671
* New: XBrowse new DATA bDelete and new Method Delete()
oBrw:Delete() evaluates oBrw:bDelete if assigned and refreshes the browse.
SetRDD(), SetADO, SetOdbf, SetArray and SetTDolphin assign default bDelete codeblocks.
So, by default oBrw:Delete() deletes the current row and refreshes the browse for RDD, ADO
Array, TDataBase and TDolphin.
* Fix: XBrowse SetADO(). Even for numeric columns with more than 2 decimal places, xbrowse
was limiting the decimal places to 2 only. Fixed now.
* Fix: TDatabase class: Method Save() was not calling method Load() after successful save,
resulting in misleading result by method Updated(). Fixed now.
* DataRow.prg improved. Method Edit() uses suitable picture clause for numeric values.
DataRow created from XBrowse can handle edits and appends
* New: TDataRow class: New Methods
SetPrompt( cFieldName, cPrompt )
or
SetPrompt( { { cFieldName1, cPrompt1 }, ... { cFieldNameN, cPromptN } } )
Enbales seetting an alternative name to a field to be used as prompt
Example: oRec:SetPrompt( "first", "First Name" )
oRec:EditMethod uses the prompt to display name of field
Value of the field can be accesssed either as oRec:First or oRec:FirstName
Query prompt of field by oRec:FieldPrompt( 1 ) or oRec:FieldPrompt( "first" ) --> "First Name"
* Enhancement: FW_ShowAdoError( oCn, [lSilent := .f.] ) now returns the ado error object. New second parameter
if set to .t., suppresses display of message but returns the error object. When error is displayed line
number and process name also is displayed.
* The two new commands DBG and LOG introduced in FWH 13.05 are renamed as FWDBG and FWLOG to avoid conflicts with
names used in application programs
* XBrowse ADO: Improved handling of multi-user editing conflicts.
* Enhancement: FW_CreateMDB( cMdbOrAccDb, [ cPassWord ] ) now accepts optional password as second paramter.
If specified the MDB/ACCDB is created with the password.
* New sample: AdoXbr01.prg in fwh\samples folder. For beginners, demonstrates creation of access database,
creation of table, copy from dbf and xbrowse with Add, Edit and Delete.
In particular demonstrates the simplest way of using AddNew(), Update() and GetRows() methods of ADO
* XBrowse: In the method SetRDD(), bSeek codeblock is created only if the programmer did not already
specified bSeek codeblock before calling SetRdd. This is to provide backward compatibility with some
legacy software where SetRDD is never called in the program
* New ADO Functions:
1) FW_CreateAdoTableSQL( cTable, aCols, [oCn], [lAddAutoInc] ) --> cSql
This function returns cSql that can be used for creation of the table by oCn:Execute( cSql )
The programmers can examine the Sql statement, make alternations if neeeded and then create the table.
aCols is an array same as DbStruct() of DBF. Appropriate column types are chosen by the function
suitable to the RDBMS used by the oCn ( connection object ).
Memo fields are considered as text only fields and suitable field type is selected by the function.
If field is to be created to hold binary data like photos, etc., filed type "M" may be changed to
"m" before calling the function.
Notes: oCn defaults to previously used connection and lAddAutoInc defaults to .t.
2) FW_CreateAdoTable( cTable, aCols, [oCn], [lAddAutoInc] ) --> lSuccess
This function uses the first function to generate sql statement and uses it to create the table.
The table is created only if the tables does not already exist.
3) FW_AdoImportFromDBF( oCn, cDbfFile, [cAdoTable], [cColPrefix], [nMultiRowSize], [acFields] )
This function creates a Table in the sql database, based on the structure of the Dbf file and also
copies data from the dbf into the sql table, all in one go.
Parameters:
1. oCn : Connection Object. If instead a connection string/ spec is specified, the connection is
opened and closed after importing the DBF.
2. cDbfFile: Dbf file name from which data is to imported. If the file is not found or can not be
opened, the function aborts with a message.
3. cAdoTableName [Optional]. By default the DBF file name is used.
4. cColPrefix: [Optinal]. The function allows creation of field names which may confilct with reserved
words. This is done by escaping the column names suitable to the RDBMS.
However it is not desirable to have column names which conflict with reserved words. To guard
against this, the programmer may specify a string to be prefixed to each column name.
Example: If cColPrefix is specified as "C_", then each column created is "C_" + field name in DBF.
5. nMultiRowSize [Optional: Default 20]: This function used SQL "INSERT" statements to speed up import
instead of ADO's AddNew(). Though MSACCESS allows only single row inserts, most other RDBMS permit
multi-row inserts. By default for RDBMS other than MSACCESS, the function prepares one SQL statement
for 20 rows and inserts 20 rows at a time. The programmer can specify a different number instead of
the default 20. Multi-row inserts are faster than single row inserts.
6. caFields: [Optional]. The programmer can specify a comma delimited list of fields to be imported.
Eg. "FIRST,STREET,CITY,SALARY". Or the programmer can specify an limited part of the dbstruct() array
containing only the fields to be imported. The array should be of the same structure as a dbstruct() array.
4) FW_AdoTableExists( cTable, [oCn] ) --> lExists
5) FW_AdoTables( [oCn] ) --> aTables
* Fix: Class TRBtn Method ShowPopup() was not properly working when invoked from a RibbonBar button
action. Now it is ok:
http://forums.fivetechsupport.com/viewt ... 82#p147882
* Fix: MsgDate() is entering into infinite loop when the first parameter dDate is an empty date.
Now fixed.
http://forums.fivetechsupport.com/viewt ... =6&t=26699
* XBrowse and TDataRow for ADO: Assignment of Empty Date Value to a Date/DateTime field
of Non-Jet (other than Access) in Harbour results in runtime error. There is no such
problem with xHarbour. Implemented a work around for Harbour till the issue is resolved.