This is the code i use:
METHOD PUBLIC VOID getData(INPUT tableName AS CHARACTER,
INPUT recordId AS INTEGER,
INPUT lineNo AS INTEGER):
DEFINE VARIABLE whereCond AS CHARACTER NO-UNDO.
" AND po_history.table_name = '" + tableName + "'" +
" AND po_history.rec_id = " + STRING(recordId) +
" AND po_history.line_no = " + STRING(lineNo).
HANDLE = ?. connectAppServer =
NEW connectAppServer (OUTPUT hdlAppServer).
RUN sHistoryGetData.p ON hdlAppServer (INPUT whereCond,
OUTPUT DATASET dsHistory).
DELETE OBJECT connectAppServer. bsHistory:
HANDLE = DATASET dsHistory:HANDLE.
bsHistory is a probindingsource which is UltraGrid's datasource.
When the method runs first time, everything's ok. UltraGrid displays all expected records. Second time i'm getting "No ... record is available (91)" error.
Thank you for any help.
Create a query against the dataset and assign the query handle instead of the prodataset handle to the bindingsource. I have the same problem when using ProDataset, and it is also slower than using a query handle.
This might work. define variable hHistoryDS as handle no-undo. hHistoryDS = DATASET dsHistory:HANDLE. hHistoryDS:top-nav-query(1):query-open(). bsHistory:HANDLE = hHistoryDS.
This might work.
define variable hHistoryDS as handle no-undo.
hHistoryDS = DATASET dsHistory:HANDLE.
bsHistory:HANDLE = hHistoryDS.
Thank you very much. It's working fine. I've just didn't noticed any speed difference. It may be because i've got just about 5000 records in ultragrid.
This works well too. Thank you