Data Object

The Data Object variable provides the basic database access functionality.

See the Data Object user interface to learn how to set up access to a data object up.

Properties

Data source - provides a database connection and allows running SQL commands against the connected data source.

Scope - allows to define criteria (conditions) for the rows used by the containing data object.

Sort - provides the ability to set and modify the sorting rules for the containing data object.

Record - identifies the current record.

Methods

Examples:

You can set output table using two methods: setting the table name (assuming you are connected to a database) - (a) and setting the entire data source - (b):

If you are writing script outside TextConverter the API looks like this:

Set DS = TextConverter.GetOutputDS()

DS.table = "tablename" )               ‘- (a)

DS.SetDS( "c:\data\output.dbf" )       ‘- (b)

 

If you are writing script inside TextConverter it looks like this:

This.DSOut.table = "tablename" )             ‘- (a)

This.DSOut.SetDS( "c:\data\output.dbf" )     ‘- (b)

     

      An Excel file is also considered as a database, so you can set the worksheet as:

   Set DS = TextConverter.GetOutputDS()

   DS.table = "worksheetname" )               ‘- (a)

DS.SetDS( "...\file.mdb:worksheetname" )   ‘- (b)

 

Select - Opens a database connection and selects a record set using the scope defined by the scope object and sorted according to the sort object.

GoTop - Moves the current record position the the first record.

GoNext - Moves the current record position to the next record.

GoPrevious - Moves the current record position to the previous record.

GoBottom - Moves the current record position to the last record.

GoRandom - Moves the current record position to the index provided as a parameter.

GetCellValue - Returns the field value for a field in the current record, for which with field name was passed in as a parameter.

GetRecordCount - Returns the number of records in the record set.

GetRecordNumber - Returns the index of the current record.

GetValues - Returns an array of values for the field(s) specified in the input parameter.

GetStatistics - Returns an array of aggregate functions (Min,Max,Sum,Count,Avg) for the field(s) specified in the input parameter.

GetFieldCount - Returns the number of fields in the underlying record set.

GetFieldName - Returns a field name for the index passed in as a parameter.

TransactionStart - Begins a batch data modification operation.  Using TransactionStart improves performance and allows to cancel all the operations included in the transaction.

TransactionFinish - Closes a batch data modification operation started with TransactionStart

AppendStart - Prepares the record set for insertion of a new record.

AppendFinish - Inserts a new record into the database table.

UpdateStart - Prepares the record set for modification of the current record data .

UpdateFinish - Finishes modification.

SetFieldValue - Sets a field value.

SetCellNull - Sets a field value to Null.

DeleteRecords - Deletes records from the database table according to the record object setup or through a scope expression passed as a parameter.

Create - Creates a new database table.

Close - Closes the current database session and frees all related resources.