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.
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. |
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 |
---|---|
Immediately before the Open event occurs in the window. |
|
When a database error occurs in the DataStore. Return codes: 0 - (Default) Display the error message. 1 - Do not display the error message. |
|
Immediately after the Close event occurs in the window. |
|
When an error is found in a data or property expression for a DataWindow object. |
|
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. |
|
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. |
|
When the printing of the DataStore ends. |
|
Before each page of the DataStore is formatted for printing. Return codes: 0 - Do not skip a page. 1 - Skip a page. |
|
When the printing of the DataStore starts. |
|
When the retrieval for the DataStore is complete. |
|
After a row has been retrieved. Return codes: 0 - (Default) Continue. 1 - Stop the retrieval. |
|
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. |
|
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. |
|
When all the updates from the DataStore to the database are complete. |
|
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. |
DataStore function |
Datatype returned |
Description |
---|---|---|
Integer |
Applies the contents of the DataStore's edit control to the current item in the DataStore buffer. |
|
Integer |
Returns the number of categories in the specified graph. (Returns an error value or an empty string for DataStores.) |
|
String |
Returns the name of the specified category in the specified graph. (Returns an error value or an empty string for DataStores.) |
|
String |
Returns the name assigned to the DataStore. |
|
Integer |
Deletes all items from the value list associated with the specified column in the DataStore. |
|
Integer |
Copies the specified graph in the DataStore to the clipboard. |
|
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. |
|
Integer |
Creates a DataWindow object using the specified source code and replaces the DataWindow object in the specified DataStore with the new DataWindow object. |
|
Integer |
Creates a DataStore object from the passed ResultSet object. |
|
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.) |
|
Integer |
Cancels a database retrieval in progress. |
|
Long |
Returns the number of rows that have been deleted from the DataStore but have not yet been updated in the associated database table. |
|
Integer |
Deletes the specified row from the DataStore. |
|
String |
Returns requested information about the structure of the DataStore. |
|
Integer |
Expands a group in a TreeView DataWindow that has the specified TreeView level and includes the specified row. |
|
Integer |
Expands all groups in a TreeView DataWindow. |
|
Integer |
Expands a group in a TreeView DataWindow that has the specified TreeView level and includes the specified row; also expands all the group's children. |
|
Integer |
Expands all the groups in a TreeView DataWindow that have the specified TreeView level. |
|
String |
Exports data from the DataWindow control, DataStore object, or DataWindowChild object to the JSON string. |
|
String |
Exports a data row from the DataWindow control, DataStore object, or DataWindowChild object to the JSON string. |
|
Integer |
Moves rows that do not meet the current filter criteria to the filter buffer. |
|
Integer |
Returns the number of rows that do not meet the current filter criteria. |
|
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. |
|
Integer |
Returns the number of the specified category in the specified graph. (Returns an error value or an empty string for DataStores.) |
|
Long |
Searches starting at a specified row for the first break for the specified group in the DataStore. |
|
Integer |
Identifies the required columns that the user has not filled. |
|
Integer |
Returns the number of the specified series in the specified graph. (Returns an error value or an empty string for DataStores.) |
|
Integer |
Creates an HTML Form element containing columns for one or more rows. Also returns an HTML Style element containing style sheet information. |
|
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. |
|
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! |
|
Long |
Retrieves changes made to a DataStore into a blob. This function is used primarily in distributed applications. |
|
Integer |
Stores in the specified variable the name of the child DataWindow in the specified column. |
|
Integer |
Obtains the number of the column the user clicked or double-clicked in a DataStore. |
|
Long |
Obtains the number of the row the user clicked or double-clicked in a DataStore. |
|
Integer |
Returns the number of the current column in the DataStore. |
|
String |
Returns the name of the current column in the DataStore. |
|
Integer |
Creates a reference to a context-specific instance of the specified service. |
|
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.) |
|
Integer |
Reports the percentage that a pie slice is exploded in a pie graph. (Returns an error value or an empty string for DataStores.) |
|
Integer |
Finds out the appearance of a data point in a graph. (Returns an error value or an empty string for DataStores.) |
|
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.) |
|
String |
Returns the format used for display in the specified column of the DataStore. |
|
Long |
Retrieves the complete state of a DataStore into a blob. This function is used primarily in distributed applications. |
|
Date |
Returns the date data in the specified row and column of the DataStore. |
|
DateTime |
Returns the datetime data in the specified row and column of the DataStore. |
|
Decimal |
Returns the decimal data in the specified row and column of the DataStore. |
|
Double |
Returns the numeric data in the specified row and column of the DataStore. |
|
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! |
|
String |
Returns the string data in the specified row and column of the DataStore. |
|
Time |
Returns the time data in the specified row and column of the DataStore. |
|
Long |
Returns the number of the first row that was modified in the specified buffer in the specified DataStore after the specified row. |
|
PowerObject |
Returns a reference to the name of the parent object. |
|
Long |
Returns an integer containing the number of the current row in the DataStore. |
|
Long |
Gets the row number of a row in a DataStore from the unique row identifier associated with that row. |
|
Long |
Gets the unique row identifier of a row in a DataStore from the row number associated with that row. |
|
Integer |
Returns the number of the first selected row after the specified row number in the DataStore. |
|
Integer |
Finds out the appearance of a series in a graph. (Returns an error value or an empty string for DataStores.) |
|
String |
Returns the current SELECT statement for the DataStore. |
|
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. |
|
String |
Returns the text in the edit control over the current row and column of the DataStore. |
|
Integer |
Returns the values in the DataStore Transaction object. |
|
String |
Returns the validation rule used in the specified column of the DataStore. |
|
String |
Returns the specified item in the value list for the specified column. |
|
Integer |
Recalculates the breaks in the groups in the DataStore. |
|
Long |
Copies data from the clipboard to the DataStore. |
|
Long |
Copies data from a file to the DataStore. |
|
Long |
Inserts data from a JSON string into the DataStore. |
|
Long |
Inserts data from a JSON string into the DataStore according to the JSON key name. |
|
Long |
Inserts a data row from a JSON string into a DataWindow control, DataStore object, or DataWindowChild object. |
|
Long |
Copies data from a string to the DataStore. |
|
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:
This function applies only to DataStores whose content has the RichText presentation style. |
|
Long |
Inserts a new initialized row before the specified row in the DataStore. |
|
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. |
|
Long |
Returns the number of rows that have been modified in the DataStore but have not yet been updated in the associated database table. |
|
String |
Uses the specification contained in a string to modify the DataStore. |
|
Long |
Pastes rich text data from a string into a DataStore whose content has the RichText presentation style. |
|
Boolean |
Adds an event to the end of the message queue for the DataStore. |
|
Integer |
Sends the content of the DataStore to the current printer. This function has several syntaxes. |
|
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. |
|
Integer |
Accesses the database to reselect all columns that can be updated and refreshes all timestamp columns in a row in the DataStore. |
|
Integer |
Clears all the data from a DataStore. |
|
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.) |
|
Integer |
Stops the DataStore from using a programmer-defined Transaction object (thereafter, the DataStore uses its internal Transaction object). |
|
Integer |
Resets the update flags for the DataStore. |
|
Long |
Causes the DataStore to retrieve rows from the database. |
|
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). |
|
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. |
|
Integer |
Discards a range of rows. The rows cannot be restored unless retrieved from the database. |
|
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. |
|
Integer |
Saves the content of the DataStore to the specified file, in the specified format, with or without column headings at the beginning |
|
Long |
Saves the content of a DataStore into a standard ASCII text file. |
|
Integer |
Saves the PDF file into a blob variable when you use the PDFlib method to save data from a DataWindow object to a PDF file. |
|
Integer |
Selects or deselects the specified row of the DataStore. |
|
Integer |
Returns the number of series in the specified graph. (Returns an error value or an empty string for DataStores.) |
|
String |
Returns the name of the specified series in the specified graph. (Returns an error value or an empty string for DataStores.) |
|
Integer |
Sets the border style of the specified column in the DataStore. |
|
Long |
Applies changes captured with GetChanges to a DataStore. This function is used primarily in distributed applications. |
|
Integer |
Makes the specified column the current column in the DataStore. |
|
Integer |
Explodes a pie slice in a pie graph. (Returns an error value or an empty string for DataStores.) |
|
Integer |
For the specified data point in the specified series in the specified graph. (Returns an error value or an empty string for DataStores.) |
|
Integer |
Sets the height of each row in a specified range. |
|
Integer |
Defines the filter criteria for the DataStore. The actual filtering is performed by the Filter function. |
|
Integer |
Sets the display format for the specified column of the DataStore. |
|
Long |
Applies the contents of a DataWindow blob retrieved by GetFullState to a DataStore. This function is used primarily in distributed applications. |
|
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. |
|
Integer |
Sets the value of the specified row and column of the specified DataStore. |
|
Integer |
Sets the status of a row in a specified column of the DataStore in the specified buffer. |
|
Integer |
Moves an object within the DataStore to another band or changes the front-to-back order of objects within a band. |
|
Integer |
Makes the specified row the current row in the DataStore. |
|
Integer |
For the specified series in the specified graph. (Returns an error value or an empty string for DataStores.) |
|
Integer |
Defines the sort criteria for the DataStore. The actual sorting is performed by the Sort function. |
|
Integer |
Sets the current SQL statement for the DataStore. |
|
Integer |
Changes the current SELECT statement for the DataStore. |
|
Integer |
Replaces the text in the edit control at the current row and column of the DataStore with the specified text. |
|
Integer |
Sets values in the DataStore's internal Transaction object. |
|
Integer |
Sets the Transaction object for the DataStore and provides control over the transaction, including the ability to commit from a script. |
|
Integer |
Changes the validation rule used for the specified column of the DataStore. |
|
Integer |
Sets the value of the specified item in the value list or the code table of the specified column of the DataStore. |
|
SetWSObject (Obsolete) |
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. |
Integer |
Shares data between a primary DataStore (or DataWindow control) and a secondary DataStore (or DataWindow control). |
|
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. |
|
Integer |
Sorts the rows of the DataStore based on its current sort criteria. |
|
Integer |
Triggers a specified event in the DataStore and executes the script for the event. |
|
Object |
Returns the type of the DataStore. |
|
Integer |
Sends to the database all inserts, deletes, and updates of the DataStore. |