DataStore object

A DataStore is a nonvisual DataWindow control. DataStores act just like DataWindow controls except that many of the visual properties associated with DataWindow controls do not apply to DataStores. Because you can print DataStores, PowerBuilder provides some events and functions for DataStores that pertain to the visual presentation of the data.

However, graph functions such as CategoryCount, CategoryName, GetData, SeriesCount, and so forth depend on the visual graph control, which is not created for a DataStore object. These functions return an error value or an empty string when used with DataStores.

Properties

DataStore property

Datatype

Description

DataObject

String

Specifies the name of the DataWindow or Report object associated with the control.

ClassDefinition

PowerObject

An object of type PowerObject containing information about the class definition of the object or control.

Object

DWObject

Used for the direct manipulation of objects within a DataWindow object from a script. These objects can be, for example, columns or text objects.


Events

Some but not all DataStore events have return codes that you can use to determine what action will be taken after the event occurs. You set the return codes in a RETURN statement in the event script.

DataStore event

Occurs

Constructor in DataWindow Reference

Immediately before the Open event occurs in the window.

DBError in DataWindow Reference

When a database error occurs in the DataStore.

Return codes:

0 - (Default) Display the error message.

1 - Do not display the error message.

Destructor in DataWindow Reference

Immediately after the Close event occurs in the window.

Error in DataWindow Reference

When an error is found in a data or property expression for a DataWindow object.

ItemChanged in DataWindow Reference

When the AcceptText and Update functions are called for the DataStore.

Return codes:

0 - (Default) Accept the data value.

1 - Reject the data value and do not allow focus to change.

2 - Reject the data value but allow focus to change.

ItemError in DataWindow Reference

When a value imported into a DataStore from a string or file does not pass the validation rules for its column. Can also occur when the AcceptText and Update functions are called for the DataStore.

Return codes:

0 - (Default) Reject the data value and show an error message box.

1 - Reject the data value with no message box.

2 - Accept the data value.

3 - Reject the data value but allow focus to change.

If the return code is 0 or 1 (rejects the data), the field with the incorrect data regains the focus.

Printend in DataWindow Reference

When the printing of the DataStore ends.

PrintPage in DataWindow Reference

Before each page of the DataStore is formatted for printing.

Return codes:

0 - Do not skip a page.

1 - Skip a page.

PrintStart in DataWindow Reference

When the printing of the DataStore starts.

RetrieveEnd in DataWindow Reference

When the retrieval for the DataStore is complete.

RetrieveRow in DataWindow Reference

After a row has been retrieved.

Return codes:

0 - (Default) Continue.

1 - Stop the retrieval.

RetrieveStart in DataWindow Reference

When the retrieval for the DataStore is about to begin.

Return codes:

0 - (Default) Continue.

1 - Do not perform the retrieval.

2 - Do not reset the rows and buffers before retrieving the data from the database.

SQLPreview in DataWindow Reference

After a Retrieve, Update, or ReselectRow function call and immediately before the SQL statement is submitted to the DBMS.

The following return codes specify the action that takes place when the event occurs after an Update function call only:

0 - (Default) Continue.

1 - Stop.

2 - Skip this request and execute the next request.

UpdateEnd in DataWindow Reference

When all the updates from the DataStore to the database are complete.

UpdateStart in DataWindow Reference

After an Update function call and just before changes in the DataStore are sent to the database.

Return codes:

0 - (Default) Continue.

1 - Do not perform the update.


Functions

DataStore function

Datatype returned

Description

AcceptText in DataWindow Reference

Integer

Applies the contents of the DataStore's edit control to the current item in the DataStore buffer.

CategoryCount in DataWindow Reference

Integer

Returns the number of categories in the specified graph. (Returns an error value or an empty string for DataStores.)

CategoryName in DataWindow Reference

String

Returns the name of the specified category in the specified graph. (Returns an error value or an empty string for DataStores.)

ClassName in DataWindow Reference

String

Returns the name assigned to the DataStore.

ClearValues in DataWindow Reference

Integer

Deletes all items from the value list associated with the specified column in the DataStore.

Clipboard in DataWindow Reference

Integer

Copies the specified graph in the DataStore to the clipboard.

CopyRTF in DataWindow Reference

String

Returns the selected text, pictures, and input fields in a DataStore as a string with rich text formatting. Bitmaps and input fields are included in the string.

Create in DataWindow Reference

Integer

Creates a DataWindow object using the specified source code and replaces the DataWindow object in the specified DataStore with the new DataWindow object.

CreateFrom in DataWindow Reference

Integer

Creates a DataStore object from the passed ResultSet object.

DataCount in DataWindow Reference

Long

Returns the number of data points in the specified series in the specified graph. (Returns an error value or an empty string for DataStores.)

DBCancel in DataWindow Reference

Integer

Cancels a database retrieval in progress.

DeletedCount in DataWindow Reference

Long

Returns the number of rows that have been deleted from the DataStore but have not yet been updated in the associated database table.

DeleteRow in DataWindow Reference

Integer

Deletes the specified row from the DataStore.

Describe in DataWindow Reference

String

Returns requested information about the structure of the DataStore.

Filter in DataWindow Reference

Integer

Moves rows that do not meet the current filter criteria to the filter buffer.

FilteredCount in DataWindow Reference

Integer

Returns the number of rows that do not meet the current filter criteria.

Find in DataWindow Reference

Long

Returns the number of the first row that meets the search criteria within a specified search range in the detail area of a DataStore.

FindCategory in DataWindow Reference

Integer

Returns the number of the specified category in the specified graph. (Returns an error value or an empty string for DataStores.)

FindGroupChange in DataWindow Reference

Long

Searches starting at a specified row for the first break for the specified group in the DataStore.

FindRequired in DataWindow Reference

Integer

Identifies the required columns that the user has not filled.

FindSeries in DataWindow Reference

Integer

Returns the number of the specified series in the specified graph. (Returns an error value or an empty string for DataStores.)

GenerateHTMLForm in DataWindow Reference

Integer

Creates an HTML Form element containing columns for one or more rows. Also returns an HTML Style element containing style sheet information.

GenerateResultSet in DataWindow Reference

Long

Returns an EAServer result set from a PowerBuilder user object running as a component on EAServer.

Obsolete function

GenerateResultSet is an obsolete function, because EAServer is no longer supported since PowerBuilder 2017.

GetBorderStyle in DataWindow Reference

Border (enumerated)

Returns a Border enumerated datatype indicating the border style of the specified column in the DataStore. Border enumerated datatypes are:

Box!

Lowered!

NoBorder!

Raised!

ResizeBorder!

ShadowBox!

Underline!

GetChanges in DataWindow Reference

Long

Retrieves changes made to a DataStore into a blob. This function is used primarily in distributed applications.

GetChild in DataWindow Reference

Integer

Stores in the specified variable the name of the child DataWindow in the specified column.

GetClickedColumn in DataWindow Reference

Integer

Obtains the number of the column the user clicked or double-clicked in a DataStore.

GetClickedRow in DataWindow Reference

Long

Obtains the number of the row the user clicked or double-clicked in a DataStore.

GetColumn in DataWindow Reference

Integer

Returns the number of the current column in the DataStore.

GetColumnName in DataWindow Reference

String

Returns the name of the current column in the DataStore.

GetContextService in DataWindow Reference

Integer

Creates a reference to a context-specific instance of the specified service.

GetData in DataWindow Reference

Double

Returns the value of the specified data in the specified series in the specified graph. (Returns an error value or an empty string for DataStores.)

GetDataPieExplode in DataWindow Reference

Integer

Reports the percentage that a pie slice is exploded in a pie graph. (Returns an error value or an empty string for DataStores.)

GetDataStyle in DataWindow Reference

Integer

Finds out the appearance of a data point in a graph. (Returns an error value or an empty string for DataStores.)

GetDataValue in DataWindow Reference

Integer

Returns the value of the specified data in the specified series in the specified graph. (Returns an error value or an empty string for DataStores.)

GetFormat in DataWindow Reference

String

Returns the format used for display in the specified column of the DataStore.

GetFullState in DataWindow Reference

Long

Retrieves the complete state of a DataStore into a blob. This function is used primarily in distributed applications.

GetItemDate in DataWindow Reference

Date

Returns the date data in the specified row and column of the DataStore.

GetItemDateTime in DataWindow Reference

DateTime

Returns the datetime data in the specified row and column of the DataStore.

GetItemDecimal in DataWindow Reference

Decimal

Returns the decimal data in the specified row and column of the DataStore.

GetItemNumber in DataWindow Reference

Double

Returns the numeric data in the specified row and column of the DataStore.

GetItemStatus in DataWindow Reference

dwItemStatus (enumerated)

Returns the status of the item at the specified row and column location in the specified buffer. Values are:

DataModified!

New!

NewModified!

NotModified!

GetItemString in DataWindow Reference

String

Returns the string data in the specified row and column of the DataStore.

GetItemTime in DataWindow Reference

Time

Returns the time data in the specified row and column of the DataStore.

GetNextModified in DataWindow Reference

Long

Returns the number of the first row that was modified in the specified buffer in the specified DataStore after the specified row.

GetParent in DataWindow Reference

PowerObject

Returns a reference to the name of the parent object.

GetRow in DataWindow Reference

Long

Returns an integer containing the number of the current row in the DataStore.

GetRowFromRowId in DataWindow Reference

Long

Gets the row number of a row in a DataStore from the unique row identifier associated with that row.

GetRowIdFromRow in DataWindow Reference

Long

Gets the unique row identifier of a row in a DataStore from the row number associated with that row.

GetSelectedRow in DataWindow Reference

Integer

Returns the number of the first selected row after the specified row number in the DataStore.

GetSeriesStyle in DataWindow Reference

Integer

Finds out the appearance of a series in a graph. (Returns an error value or an empty string for DataStores.)

GetSQLSelect in DataWindow Reference

String

Returns the current SELECT statement for the DataStore.

GetStateStatus in DataWindow Reference

Long

Retrieves the current status of the internal state flags for a DataWindow and places this information in a blob. This function is used primarily in distributed applications.

GetText in DataWindow Reference

String

Returns the text in the edit control over the current row and column of the DataStore.

GetTrans in DataWindow Reference

Integer

Returns the values in the DataStore Transaction object.

GetValidate in DataWindow Reference

String

Returns the validation rule used in the specified column of the DataStore.

GetValue in DataWindow Reference

String

Returns the specified item in the value list for the specified column.

GroupCalc in DataWindow Reference

Integer

Recalculates the breaks in the groups in the DataStore.

ImportClipboard in DataWindow Reference

Long

Copies data from the clipboard to the DataStore.

ImportFile in DataWindow Reference

Long

Copies data from a file to the DataStore.

ImportString in DataWindow Reference

Long

Copies data from a string to the DataStore.

InsertDocument in DataWindow Reference

Integer

Inserts a rich text format or plain text file into a DataStore. You use a function parameter to specify how the new content is added:

  • It can be inserted at the insertion point

  • It can replace all existing content

This function applies only to DataStores whose content has the RichText presentation style.

InsertRow in DataWindow Reference

Long

Inserts a new initialized row before the specified row in the DataStore.

IsSelected in DataWindow Reference

Boolean

Returns true if the specified row in the DataStore is selected; returns false if the row is not selected or is greater than the number of rows in the DataStore.

ModifiedCount in DataWindow Reference

Long

Returns the number of rows that have been modified in the DataStore but have not yet been updated in the associated database table.

Modify in DataWindow Reference

String

Uses the specification contained in a string to modify the DataStore.

PasteRTF in DataWindow Reference

Long

Pastes rich text data from a string into a DataStore whose content has the RichText presentation style.

PostEvent in DataWindow Reference

Boolean

Adds an event to the end of the message queue for the DataStore.

Print in DataWindow Reference

Integer

Sends the content of the DataStore to the current printer. This function has several syntaxes.

PrintCancel in DataWindow Reference

Integer

Cancels the print job and deletes the spool file (if any) when the content of the DataStore is sent to print.

This function has two syntaxes. Use Syntax 1 when Syntax 1 of the Print function was used to send it to print.

ReselectRow in DataWindow Reference

Integer

Accesses the database to reselect all columns that can be updated and refreshes all timestamp columns in a row in the DataStore.

Reset in DataWindow Reference

Integer

Clears all the data from a DataStore.

ResetDataColors in DataWindow Reference

Integer

Resets the color of a data point to the color specified for the series. (Returns an error value or an empty string for DataStores.)

ResetTransObject in DataWindow Reference

Integer

Stops the DataStore from using a programmer-defined Transaction object (thereafter, the DataStore uses its internal Transaction object).

ResetUpdate in DataWindow Reference

Integer

Resets the update flags for the DataStore.

Retrieve in DataWindow Reference

Long

Causes the DataStore to retrieve rows from the database.

RowCount in DataWindow Reference

Long

Returns the number of rows currently available in the DataStore (all the rows retrieved minus any deleted rows plus any inserted rows minus any rows that have been filtered out).

RowsCopy in DataWindow Reference

Integer

Copies a range of rows from one DataStore to another DataStore (or DataWindow control) or from one buffer to another within a single DataStore.

RowsDiscard in DataWindow Reference

Integer

Discards a range of rows. The rows cannot be restored unless retrieved from the database.

RowsMove in DataWindow Reference

Integer

Clears a range of rows from a DataStore and inserts the rows in another DataStore (or DataWindow control) or another buffer of the same DataStore.

SaveAs in DataWindow Reference

Integer

Saves the content of the DataStore to the specified file, in the specified format, with or without column headings at the beginning

SaveAsAscii in DataWindow Reference

Long

Saves the content of a DataStore into a standard ASCII text file.

SelectRow in DataWindow Reference

Integer

Selects or deselects the specified row of the DataStore.

SeriesCount in DataWindow Reference

Integer

Returns the number of series in the specified graph. (Returns an error value or an empty string for DataStores.)

SeriesName in DataWindow Reference

String

Returns the name of the specified series in the specified graph. (Returns an error value or an empty string for DataStores.)

SetBorderStyle in DataWindow Reference

Integer

Sets the border style of the specified column in the DataStore.

SetChanges in DataWindow Reference

Long

Applies changes captured with GetChanges to a DataStore. This function is used primarily in distributed applications.

SetColumn in DataWindow Reference

Integer

Makes the specified column the current column in the DataStore.

SetDataPieExplode in DataWindow Reference

Integer

Explodes a pie slice in a pie graph. (Returns an error value or an empty string for DataStores.)

SetDataStyle in DataWindow Reference

Integer

For the specified data point in the specified series in the specified graph. (Returns an error value or an empty string for DataStores.)

SetDetailHeight in DataWindow Reference

Integer

Sets the height of each row in a specified range.

SetFilter in DataWindow Reference

Integer

Defines the filter criteria for the DataStore. The actual filtering is performed by the Filter function.

SetFormat in DataWindow Reference

Integer

Sets the display format for the specified column of the DataStore.

SetFullState in DataWindow Reference

Long

Applies the contents of a DataWindow blob retrieved by GetFullState to a DataStore. This function is used primarily in distributed applications.

SetHTMLAction in DataWindow Reference

Integer

Accepts action and context information about user interaction with the Web DataWindow client control in a Web browser so that newly generated HTML can reflect any requested changes.

Obsolete function

SetHTMLAction is an obsolete function, because Web DataWindow technology is obsolete.

SetItem in DataWindow Reference

Integer

Sets the value of the specified row and column of the specified DataStore.

SetItemStatus in DataWindow Reference

Integer

Sets the status of a row in a specified column of the DataStore in the specified buffer.

SetPosition in DataWindow Reference

Integer

Moves an object within the DataStore to another band or changes the front-to-back order of objects within a band.

SetRow in DataWindow Reference

Integer

Makes the specified row the current row in the DataStore.

SetSeriesStyle in DataWindow Reference

Integer

For the specified series in the specified graph. (Returns an error value or an empty string for DataStores.)

SetSort in DataWindow Reference

Integer

Defines the sort criteria for the DataStore. The actual sorting is performed by the Sort function.

SetSQLPreview in DataWindow Reference

Integer

Sets the current SQL statement for the DataStore.

SetSQLSelect in DataWindow Reference

Integer

Changes the current SELECT statement for the DataStore.

SetText in DataWindow Reference

Integer

Replaces the text in the edit control at the current row and column of the DataStore with the specified text.

SetTrans in DataWindow Reference

Integer

Sets values in the DataStore's internal Transaction object.

SetTransObject in DataWindow Reference

Integer

Sets the Transaction object for the DataStore and provides control over the transaction, including the ability to commit from a script.

SetValidate in DataWindow Reference

Integer

Changes the validation rule used for the specified column of the DataStore.

SetValue in DataWindow Reference

Integer

Sets the value of the specified item in the value list or the code table of the specified column of the DataStore.

SetWSObject in DataWindow Reference

Integer

Causes a DataStore (or DataWindow control) to use a programmer-specified connection object. The connection object provides the information necessary for communicating with a Web service data source.

ShareData in DataWindow Reference

Integer

Shares data between a primary DataStore (or DataWindow control) and a secondary DataStore (or DataWindow control).

ShareDataOff in DataWindow Reference

Integer

Turns off sharing for the DataStore. If the DataStore is primary, all secondary DataStores (or DataWindow controls) are disconnected and their DataWindow objects no longer contain data.

Sort in DataWindow Reference

Integer

Sorts the rows of the DataStore based on its current sort criteria.

TriggerEvent in DataWindow Reference

Integer

Triggers a specified event in the DataStore and executes the script for the event.

TypeOf in DataWindow Reference

Object

Returns the type of the DataStore.

Update in DataWindow Reference

Integer

Sends to the database all inserts, deletes, and updates of the DataStore.