Functions

Functions

int mdlDBDialog_firstRow (MSDialog *dbP)
 Synchronizes the database form dbP with the first record of the query. More...
 
int mdlDBDialog_lastRow (MSDialog *dbP)
 Synchronizes the database form dbP with the last record of the query. More...
 
int mdlDBDialog_startQuery (MSDialog *dbP)
 Creates and executes the SQL query generated from the database form and displays the first query result. More...
 
int mdlDBDialog_clearValues (MSDialog *dbP)
 Clears all column values from the database form dbP. More...
 
int mdlDBDialog_nextRow (MSDialog *dbP)
 Synchronizes the database form dbP with the next record of the query. More...
 
int mdlDBDialog_prevRow (MSDialog *dbP)
 Synchronizes the database form dbP with the previous record of the query. More...
 
int mdlDBDialog_nextPage (MSDialog *dbP)
 Scrolls the multi-paged database form dbP to the next page. More...
 
int mdlDBDialog_prevPage (MSDialog *dbP)
 Scrolls the multi-paged database form dbP to the previous page. More...
 
int mdlDBDialog_updateCurrentRow (MSDialog *dbP)
 Updates the current record with column values present in the database form. More...
 
int mdlDBDialog_deleteCurrentRow (MSDialog *dbP)
 Deletes the current record from the primary table. More...
 
int mdlDBDialog_insertRow (MSDialog *dbP)
 Inserts a new row to the primary table with the column values present in the database form. More...
 
int mdlDBDialog_itemGetState (WChar **statePP, MSDialog *dbP, int itemIndex)
 Gets a pointer to the value of the item at itemIndex on the database form dbP. More...
 
int mdlDBDialog_itemSetState (MSDialog *dbP, int itemIndex, WChar *stateP)
 Sets the value of the item at itemIndex on the database form dbP. More...
 
int mdlDBDialog_setPage (MSDialog *dbP, int pageNum)
 Scrolls the multi-paged database form dbP to pageNum. More...
 
int mdlDBDialog_totalPages (MSDialog *dbP)
 Used to get the maximum page number from the dialog query information. More...
 
int mdlDBDialog_processUserQuery (MSDialog *dbP, WCharCP userQueryP)
 Selects all the rows satisfying the WHERE clause specified by userQueryP and synchronizes the form with the query results. More...
 
MSDialogmdlDBDialog_openForm (RscId dialogId, WCharCP tableName, WCharCP columnList, WCharCP condition, UInt32 itemMask, UInt32 attributes)
 Dynamically creates and displays an MDL based multi page database form using the specified primary tablename, column list, query conditions, database features and attributes. More...
 
int mdlDBDialog_openModal (int *lastActionP, WCharCP tableName, WCharCP columnList, int dialogHookID)
 Used to open the database dialog box with the primary table name, in a modal fashion. More...
 
MSDialogmdlDBDialog_openReport (RscId dialogId, WCharCP tableName, WCharCP columnList, WCharCP condition, UInt32 itemMask, UInt32 attributes)
 Used to open the specified dialog box and populate it with a report generated using the specified table name, column names, WHERE clause, items and attributes. More...
 
int mdlDBDialog_generateRscFile (WCharCP rscFileName, RscId dialogId, WCharCP tableName, WCharCP columnList, UInt32 itemMask, UInt32 attributes)
 Generates (creates, writes and closes) a resource file containing the dialog and item resources of the database form using the specified primary tablename, column list and database features. More...
 
int mdlDBDialog_attachCurrentRow (MSDialog *dbP)
 Prompts and attaches the current row displayed in the database form to the element(s) selected. More...
 
int mdlDBDialog_review (MSDialog *dbP)
 Prompts and reviews the database linkages of the element(s) linked to the primary table. More...
 
int mdlDBDialog_detachCurrentRow (MSDialog *dbP)
 Prompts and detaches the current row displayed in the database form from the element(s) selected. More...
 
int mdlDBDialog_locateCurrentRow (MSDialog *dbP)
 Locates one after the other, all elements linked to the current row from the map pointed by the MAPID field. More...
 
int mdlDBDialog_fetchRow (MS_sqlda *sqlda, MSDialog *dbP)
 Used to retrieve the next row of the query in the specified database dialog box. More...
 
int mdlDBDialog_openFormFromElement (MSElementP el, RscId *dialogId)
 Opens database form for each linkage on the element, el. More...
 
int mdlDBDialog_useFenceIfActive (MSDialog *dbP, int useFence)
 Sets or gets the USE FENCE flag associated with the database form dbP to decide whether to use the fence elements with the linkage functions if a fence is active. More...
 
void mdlDBDialog_publishExtraHooks ()
 Publishes the hooks for some of the database items created by mdlDBDialog_openForm functions. More...
 
int mdlDBDialog_queryRscFile (RscId *dialogId, WCharP tableName, RscFileHandle rFileH)
 Retrieves the database form id and table name from the resource file created by mdlDBDialog_generateRscFile. More...
 
int mdlDBDialog_queryRscExtended (RscId *dialogId, WChar *tableName, WChar **joinTables, WChar **columnList, RscFileHandle rFileH)
 Used to query a MicroStation resource file for information about the dialog box contained within it. More...
 
WCharCP mdlDBDialog_getPrimaryTable (MSDialog *dbP)
 Used to get the primary table from the specified database dialog box. More...
 
WCharCP mdlDBDialog_getPrimaryKeyValue (MSDialog *dbP)
 Used to get the primary key value from the specified database dialog box. More...
 
MSDialogmdlDBDialog_find (WCharCP tableNameP, MdlDesc *ownerMD)
 Used to find the database dialog box associated with the specified name. More...
 
void mdlDBDialog_setDateDelimiters (WCharCP beforeP, WCharCP afterP)
 Used to set the delimiters to use before and following a date value. More...
 
void mdlDBDialog_getDateDelimiters (WCharP beforeP, WCharP afterP)
 Used to get the delimiters to use before and following a date value. More...
 
MSDialogP mdlDialog_openWithDBQuery (RscFileHandle rFileH, MdlDescP ownerMD, RscId resourceId, WCharCP primaryTableName, WCharCP dbQueryStrP, bool executeQuery, UInt32 options)
 A low level function which opens a database form from a resource file. More...
 

Detailed Description

Function Documentation

int mdlDBDialog_attachCurrentRow ( MSDialog dbP)

Prompts and attaches the current row displayed in the database form to the element(s) selected.

This also works on fence elements if a fence is active and the Use Fence flag is not set to OFF by calling mdlDBDialog_useFenceIfActive.

Remarks
Unlike the ATTACH AE command, this function does not require or use an AE table.
Parameters
[in]dbPDialog box ptr for database row to attach.
Returns
SUCCESS is returned if database form contains enough information to create a database linkage.
See also
mdlDBDialog_detachCurrentRow mdlDBDialog_useFenceIfActive
int mdlDBDialog_clearValues ( MSDialog dbP)

Clears all column values from the database form dbP.

Parameters
[in]dbPPointer for dialog to clear values.
Returns
SUCCESS is returned if dbP is a valid database form.
See also
mdlDBDialog_openForm mdlDBDialog_startQuery mdlDialog_openWithDBQuery
int mdlDBDialog_deleteCurrentRow ( MSDialog dbP)

Deletes the current record from the primary table.

Delete is done based on the primary key value.

Parameters
[in]dbPDialog box ptr for dialog containing row to update.
Returns
SUCCESS is returned if the record is successfully deleted from the primary table.
See also
mdlDBDialog_insertRow
int mdlDBDialog_detachCurrentRow ( MSDialog dbP)

Prompts and detaches the current row displayed in the database form from the element(s) selected.

This also works on fence elements if a fence is active and the Use Fence flag is not set to OFF by calling mdlDBDialog_useFenceIfActive.

Remarks
Unlike MicroStation DETACH command, this function does not detach all the linkages but only the one displayed in the form.
Parameters
[in]dbPDetach database row reviewed.
Returns
SUCCESS is returned if database form contains enough information to decide which database linkage to detach.
See also
mdlDBDialog_attachCurrentRow mdlDBDialog_useFenceIfActive
int mdlDBDialog_fetchRow ( MS_sqlda sqlda,
MSDialog dbP 
)

Used to retrieve the next row of the query in the specified database dialog box.

This function only works for key array based database forms.

Parameters
[out]sqldaThe row of the database query.
[in]dbPThe dialog containing the query.
Returns
SUCCESS is returned if the operation is completed successfully.
MSDialog* mdlDBDialog_find ( WCharCP  tableNameP,
MdlDesc ownerMD 
)

Used to find the database dialog box associated with the specified name.

Optionally, the Id of the mdl task that owns the dialog can be passed in to this function.

Parameters
[in]tableNamePThe table name of the dbform to find.
[in]ownerMDThe Id of the mdl task that owns the dialog. This may be NULL.
Returns
A pointer to the dialog box, if it is found.
int mdlDBDialog_firstRow ( MSDialog dbP)

Synchronizes the database form dbP with the first record of the query.

Parameters
[in]dbPDialog box pointer for dialog to advance to first row.
Returns
SUCCESS is returned if dbP is a valid database form with an active query.
See also
mdlDBDialog_openForm mdlDialog_openWithDBQuery mdlDBDialog_lastRow mdlDBDialog_prevRow
int mdlDBDialog_generateRscFile ( WCharCP  rscFileName,
RscId  dialogId,
WCharCP  tableName,
WCharCP  columnList,
UInt32  itemMask,
UInt32  attributes 
)

Generates (creates, writes and closes) a resource file containing the dialog and item resources of the database form using the specified primary tablename, column list and database features.

The resource file created by this function can be edited using the DBDIALOG (Resource->Edit) or BUILDER applications and can be used with mdlDialog_openWithDBQuery or mdlDBDialog_openFormFromElement.

Parameters
[in]rscFileNameSpecifies target file to be created.
[in]dialogIdSpecifies the unique resource Id to be assigned to the database dialog form.
[in]tableNameSpecifies the primary table name for which the database form is opened. This is also the title of the form.
[in]columnListSpecifies the list of columns that should appear on the form. Column names are separated by commas. If columnList is NULL, all the columns of the primary table will appear on the database form.
[in]itemMaskSpecifies the standard database features the database form should come up with. See mdlDBDialog_openForm for more information.
[in]attributesNot implemented, pass 0L always.
Returns
SUCCESS is returned if the resource file is generated successfully and ERROR otherwise.
See also
mdlDBDialog_openForm mdlDBDialog_queryRscFile mdlDialog_openWithDBQuery
void mdlDBDialog_getDateDelimiters ( WCharP  beforeP,
WCharP  afterP 
)

Used to get the delimiters to use before and following a date value.

Parameters
[out]beforePThe delimiter to use before the date value.
[out]afterPThe delimiter to use following the date value.
See also
mdlDBDialog_setDateDelimiters
WCharCP mdlDBDialog_getPrimaryKeyValue ( MSDialog dbP)

Used to get the primary key value from the specified database dialog box.

Parameters
[in]dbPA pointer to the dialog box from which the primary key value is obtained.
Returns
A pointer to the primary key value specified in the dialog box.
See also
mdlDBDialog_getPrimaryTable
WCharCP mdlDBDialog_getPrimaryTable ( MSDialog dbP)

Used to get the primary table from the specified database dialog box.

Parameters
[in]dbPA pointer to the dialog box from which the primary table is obtained.
Returns
A pointer to the primary table specified in the dialog box.
See also
mdlDBDialog_getPrimaryTable
int mdlDBDialog_insertRow ( MSDialog dbP)

Inserts a new row to the primary table with the column values present in the database form.

If the primary key is MSLINK and a record is already existing with the given MSLINK value then mdlDBDialog_insertRow will attempt to insert the record with the next available MSLINK value.

Parameters
[in]dbPDialog box ptr for dialog containing row to update.
Returns
SUCCESS is returned if the record is successfully added to the primary table.
See also
mdlDBDialog_deleteCurrentRow
int mdlDBDialog_itemGetState ( WChar **  statePP,
MSDialog dbP,
int  itemIndex 
)

Gets a pointer to the value of the item at itemIndex on the database form dbP.

Parameters
[out]statePPItem's external state.
[in]dbPDialog box ptr for item.
[in]itemIndexItem index of item for which to get state
Returns
SUCCESS is returned if the value is retrieved successfully.
See also
mdlDBDialog_insertRow mdlDBDialog_updateCurrentRow mdlDBDialog_itemSetState
int mdlDBDialog_itemSetState ( MSDialog dbP,
int  itemIndex,
WChar *  stateP 
)

Sets the value of the item at itemIndex on the database form dbP.

Parameters
[in]dbPDialog box pointer for item.
[in]itemIndexItem index of item for which to set state.
[in]statePState to set item to.
Returns
SUCCESS is returned if the value is set successfully.
See also
mdlDBDialog_insertRow mdlDBDialog_updateCurrentRow mdlDBDialog_itemGetState
int mdlDBDialog_lastRow ( MSDialog dbP)

Synchronizes the database form dbP with the last record of the query.

mdlDBDialog_nextRow synchronizes the database form dbP with the next record of the query.

Parameters
[in]dbPDialog Box ptr for dialog to advance to last row.
Returns
SUCCESS is returned if dbP is a valid database form with an active query.
See also
mdlDBDialog_openForm mdlDialog_openWithDBQuery mdlDBDialog_firstRow mdlDBDialog_prevRow
int mdlDBDialog_locateCurrentRow ( MSDialog dbP)

Locates one after the other, all elements linked to the current row from the map pointed by the MAPID field.

If the primary table does not have a MAPID field, it looks at the master file for elements linked to the current row. Located elements are hilited and displayed with a red halo around them in the selected view. Until there are no more elements linked to the current row to be displayed, it keeps prompting you to identify views to display the elements.

Parameters
[in]dbPDialog box ptr for database row to attach.
Returns
SUCCESS is returned if database form contains enough information to decide which database linkage to locate.
See also
mdlDBDialog_review mdlDBDialog_attachCurrentRow
int mdlDBDialog_nextPage ( MSDialog dbP)

Scrolls the multi-paged database form dbP to the next page.

Parameters
[in]dbPDialog box ptr for dialog to advance to next page.
Returns
This function returns SUCCESS if dbP is a multi-paged database form with a suitable current state.
See also
mdlDBDialog_openForm mdlDialog_openWithDBQuery mdlDBDialog_prevPage mdlDBDialog_setPage
int mdlDBDialog_nextRow ( MSDialog dbP)

Synchronizes the database form dbP with the next record of the query.

Parameters
[in]dbPDialog Box ptr for dialog to advance to next row.
Returns
SUCCESS is returned if dbP is a valid database form with an active query.
See also
mdlDBDialog_openForm mdlDialog_openWithDBQuery mdlDBDialog_lastRow mdlDBDialog_firstRow mdlDBDialog_prevRow
MSDialog* mdlDBDialog_openForm ( RscId  dialogId,
WCharCP  tableName,
WCharCP  columnList,
WCharCP  condition,
UInt32  itemMask,
UInt32  attributes 
)

Dynamically creates and displays an MDL based multi page database form using the specified primary tablename, column list, query conditions, database features and attributes.

Parameters
[in]dialogIdSpecifies the unique id to be assigned to the new database form. Users must make sure that this id is different from other dialog box resource Ids present in their application.
[in]tableNameSpecifies the primary table name for which the database form is opened. This is also the title of the form.
[in]columnListSpecifies the list of columns that should appear on the form. Column names are separated by commas. If columnList is NULL, all of the columns of the primary table will appear on the database form.
[in]conditionSpecifies the WHERE clause used while creating the SELECT statement which is getting executed on opening the form. If condition is NULL, all rows of the primary table will be selected.
[in]itemMaskSpecifies the standard database features the database form should come up with. This must be a bitmapped UInt32 that may contain any combinations of the following constants.

Constant Description

Constant Description
DBDIALOG_BUTTON_ATTACH Include Attach Linkage push button.
DBDIALOG_BUTTON_DEFAULT Add all the default database features which includes First, Next and Last buttons for record scrolling, Query, Clear, Insert, Update and Delete buttons for record modification.
DBDIALOG_BUTTON_DETACH Include Detach Linkage push button.
DBDIALOG_BUTTON_LOCATE Include Locate Linkage push button.
DBDIALOG_BUTTON_NOCLEAR Do not include Clear push button.
DBDIALOG_BUTTON_NODELETE Do not include Delete push button.
DBDIALOG_BUTTON_NOFIRST Do not include First push button for record scrolling.
DBDIALOG_BUTTON_NOINSERT Do not include Insert push button.
DBDIALOG_BUTTON_NOLAST Do not include Last push button for record scrolling.
DBDIALOG_BUTTON_NONEXT Do not include Next push button for record scrolling.
DBDIALOG_BUTTON_NOQUERY Do not include Query push button
DBDIALOG_BUTTON_NOUPDATE Do not include Update push button.
DBDIALOG_BUTTON_PREVROW Include Previous push button for record scrolling. This is valid only for the default key array based database forms. (=> if DBDIALOGATTR_CURSORBASED bit is not set in attributes)
DBDIALOG_BUTTON_REVIEW Include Review Linkage push button.
DBDIALOG_GRAPHICS_ITEMS Add all the default database linkage features which includes Attach, Review, Detach and Locate buttons.
DBDIALOG_LABEL_COUNTROW Include the active and total record count labels at the top of the form. This is valid only for the default key array based database forms.
DBDIALOG_MLTEXT_QUERY Include a multiline text box where user can enter SQL queries.
DBDIALOG_TOGGLE_USEFENCE Include `Use Fence if Active' toggle button to decide whether to use fence while doing graphic operation.
Parameters
[in]attributesThe attributes parameter specifies various attributes for the database form. Default is 0L. At present there are only two options supported. This must be a bitmapped UInt32 that may contain any combinations of the following constants.
Constant Description
DBDIALOGATTR_CURSORBASED Use the native Database Cursor based form instead of the default key array based. Cursor based form does not support the Previous record feature or displaying record Counts.
DBDIALOGATTR_NOQUERYEXECUTE Do not execute queries or fetch column values on opening the form. This makes the form come up without any delay.
Returns
A pointer to the opened dialog box is returned. NULL is returned if the table or column list specified is not valid or the given dialog id is already in use.
See also
mdlDBDialog_publishExtraHooks mdlDialog_openWithDBQuery mdlDBDialog_openFormFromElement
int mdlDBDialog_openFormFromElement ( MSElementP  el,
RscId dialogId 
)

Opens database form for each linkage on the element, el.

If dialogId is NULL, it looks at the directory pointed by MS_DBDIALOGRSC to check whether dialog resource files with the names matching to the entity number (i.e., parcel.rsc) exist there. If found, it uses these resources to create the database forms.

Parameters
[in]elLinked element.
[in]dialogIdIf dialogId is not NULL, it calls mdlDBDialog_openForm for each linkage with the entity table as primary table listing all columns and using form Id starting from the dialogId value.
Returns
SUCCESS is returned if database forms are opened successfully.
See also
mdlDBDialog_generateRscFile mdlDialog_openWithDBQuery
int mdlDBDialog_openModal ( int *  lastActionP,
WCharCP  tableName,
WCharCP  columnList,
int  dialogHookID 
)

Used to open the database dialog box with the primary table name, in a modal fashion.

Parameters
[out]lastActionPIndicates the user's last action in the dialog. This is usually the value of an action button within the dialog to either accept or cancel.
[in]tableNameThe primary table in the dialog.
[in]columnListA list of the column names to display. Passing NULL means display all columns.
[in]dialogHookIDIdentifies the hook function to call. Pass NOHOOK if a hook function is not being used.
Returns
SUCCESS is returned if the dialog is opened successfully, otherwise ERROR.
MSDialog* mdlDBDialog_openReport ( RscId  dialogId,
WCharCP  tableName,
WCharCP  columnList,
WCharCP  condition,
UInt32  itemMask,
UInt32  attributes 
)

Used to open the specified dialog box and populate it with a report generated using the specified table name, column names, WHERE clause, items and attributes.

This function creates a temporary resource file which is removed when the function is completed.

Parameters
[in]dialogIdThe unique Id for the dialog box to display the report.
[in]tableNameThe name of the primary table to use in generating the report.
[in]columnListA list of the columns to display. Pass NULL to display all columns.
[in]conditionThe WHERE clause to use in generating the report.
[in]itemMaskA mask of items to display in the dialog box.
[in]attributesA list of OR'd attribute values to apply to the dialog box.
Returns
A pointer to the dialog box displaying the report, or NULL if an error occurred. Possible values for mdlErrno include: MDLERR_RSCWRITEERROR and MDLERR_BADARG.
int mdlDBDialog_prevPage ( MSDialog dbP)

Scrolls the multi-paged database form dbP to the previous page.

Parameters
[in]dbPDialog box ptr for dialog to move to previous page
Returns
SUCCESS is returned if dbP is a multi-paged database form with a suitable current state.
See also
mdlDBDialog_openForm mdlDialog_openWithDBQuery mdlDBDialog_nextPage mdlDBDialog_setPage
int mdlDBDialog_prevRow ( MSDialog dbP)

Synchronizes the database form dbP with the previous record of the query.

This function only works for key array based database forms.

Parameters
[in]dbPDialog Box ptr for dialog to advance to previous row.
Returns
SUCCESS is returned if dbP is a valid database form with an active query.
See also
mdlDBDialog_openForm mdlDialog_openWithDBQuery mdlDBDialog_firstRow mdlDBDialog_lastRow mdlDBDialog_nextRow
int mdlDBDialog_processUserQuery ( MSDialog dbP,
WCharCP  userQueryP 
)

Selects all the rows satisfying the WHERE clause specified by userQueryP and synchronizes the form with the query results.

Parameters
[in]dbPDatabase dialog to display query output.
[in]userQueryPCan be any valid SQL WHERE clause (i.e., "WHERE MSLINK<= 10"). If NULL is passed, it selects all the rows.
Returns
SUCCESS is returned if no errors occur.
See also
mdlDBDialog_startQuery
void mdlDBDialog_publishExtraHooks ( )

Publishes the hooks for some of the database items created by mdlDBDialog_openForm functions.

This needs to be called once in the application after publishing the user hooks.

Remarks
It is advisable to call this function in the following order if your application uses one of the mdlDBDialog_openForm functions.
mdlDialog_publishHooks(..);
See also
mdlDBDialog_openForm mdlDBDialog_openFormFromElement
int mdlDBDialog_queryRscExtended ( RscId dialogId,
WChar *  tableName,
WChar **  joinTables,
WChar **  columnList,
RscFileHandle  rFileH 
)

Used to query a MicroStation resource file for information about the dialog box contained within it.

Parameters
[out]dialogIdThe Id of the dialog found in the resource file.
[out]tableNameThe primary table name specified in the dialog box.
[out]joinTablesA list of table joins specified by the dialog box.
[out]columnListA list of columns specified by the dialog box.
[in]rFileHA handle to the resource file to query.
Returns
SUCCESS is returned if the resource file is found, and queried successfully.
int mdlDBDialog_queryRscFile ( RscId dialogId,
WCharP  tableName,
RscFileHandle  rFileH 
)

Retrieves the database form id and table name from the resource file created by mdlDBDialog_generateRscFile.

Parameters
[out]dialogIdSpecifies the unique resource id assigned to the database dialog form. If NULL, it is not retrieved.
[out]tableNameSpecifies the primary table name of the database form present in the resource file. If NULL, table name is not retrieved.
[in]rFileHSpecifies the resource file to search for the database form resource.
Returns
SUCCESS is returned if the requested information is retrieved successfully and ERROR otherwise.
See also
mdlDBDialog_generateRscFile mdlDialog_openWithDBQuery
int mdlDBDialog_review ( MSDialog dbP)

Prompts and reviews the database linkages of the element(s) linked to the primary table.

It initializes current query and synchronizes the database form with the review results. This also works on fence elements if a fence is active and the Use Fence flag is not set OFF by calling mdlDBDialog_useFenceIfActive.

Remarks
Unlike MicroStation REVIEW command, this function does not review all linkages, but only the ones to the primary table of the database form dbP.
Parameters
[in]dbPDialog box ptr for updating database row reviewed.
Returns
SUCCESS is returned if the primary table of the database form has MSLINK column and an entry in MSCATALOG table.
See also
mdlDBDialog_openFormFromElement mdlDBDialog_useFenceIfActive
void mdlDBDialog_setDateDelimiters ( WCharCP  beforeP,
WCharCP  afterP 
)

Used to set the delimiters to use before and following a date value.

Parameters
[in]beforePThe delimiter to use before the date value.
[in]afterPThe delimiter to use following the date value.
See also
mdlDBDialog_getDateDelimiters
int mdlDBDialog_setPage ( MSDialog dbP,
int  pageNum 
)

Scrolls the multi-paged database form dbP to pageNum.

Parameters
[in]dbPDatabase dialog for which to set page.
[in]pageNumPage number to set to.
Returns
SUCCESS is returned if dbP is a multi-paged database form with a suitable current state.
See also
mdlDBDialog_openForm mdlDialog_openWithDBQuery mdlDBDialog_prevPage mdlDBDialog_nextPage
int mdlDBDialog_startQuery ( MSDialog dbP)

Creates and executes the SQL query generated from the database form and displays the first query result.

If found, it first attempts to form a SELECT statement from the multiline query box item MLTEXTID_DBQuery.

Remarks
Users can enter any valid WHERE clause in this field before calling mdlDBDialog_startQuery.
In case of no or empty multiline query item, mdlDBDialog_startQuery attempts to create and execute the SELECT statement using the values and operators available with the database field items. The default arithmetical operator is EQUAL TO (=). Other operators recognized by mdlDBDialog_startQuery are listed below:
Operator Description
% like
! not equal to
< less than
> greater than
<= less than or equal to
>= greater than or equal to
AND is the default logical operator. Users need to add a pipe '|' character at the end of the values to use OR as the connection operator instead.
If all the fields are cleared before calling mdlDBDialog_startQuery, it selects all the rows from primary table.
Parameters
[in]dbPPointer for dialog to initialize the query.
Returns
SUCCESS is returned if no errors occur.
See also
mdlDBDialog_processUserQuery mdlDBDialog_clearValues
int mdlDBDialog_totalPages ( MSDialog dbP)

Used to get the maximum page number from the dialog query information.

Parameters
[in]dbPIs a pointer to the dialog box.
Returns
An integer value indicating the max pages value for the dialog.
int mdlDBDialog_updateCurrentRow ( MSDialog dbP)

Updates the current record with column values present in the database form.

Update is done based on the primary key value.

Parameters
[in]dbPDialog box ptr for dialog containing row to update.
Returns
SUCCESS is returned if the record is successfully updated.
See also
mdlDBDialog_insertRow
int mdlDBDialog_useFenceIfActive ( MSDialog dbP,
int  useFence 
)

Sets or gets the USE FENCE flag associated with the database form dbP to decide whether to use the fence elements with the linkage functions if a fence is active.

Parameters
[in,out]dbPDialog form to set/get the use fence flag.
[in]useFenceIf useFence is either true or false, it sets the USE FENCE flag to ON or OFF. If -1, is passed it retrieves the current state of the USE FENCE flag.
Returns
SUCCESS is returned if useFence is either true or false and the flag is set successfully. If useFence is -1, it returns true or false depending on USE FENCE flag is ON or OFF.
See also
mdlDBDialog_review mdlDBDialog_attachCurrentRow mdlDBDialog_detachCurrentRow
MSDialogP mdlDialog_openWithDBQuery ( RscFileHandle  rFileH,
MdlDescP  ownerMD,
RscId  resourceId,
WCharCP  primaryTableName,
WCharCP  dbQueryStrP,
bool  executeQuery,
UInt32  options 
)

A low level function which opens a database form from a resource file.

Database form is a Dialog Box with database attribute bit DIALOGATTR_DATABASE set.

Parameters
[in]rFileHspecifies the resource file to search for the database form resource. If NULL, all the calling application's open resource files and then MicroStation's open resource files will be searched.
[in]resourceIdspecifies the resource ID of the Dialog Box resource that is used to create the database form. The dialog resource for a database form can contain items hooked to database fields.
Remarks
For example, users may hook the field `owner' from `property' table to the text item TEXTID_Owner in either of the two methods listed below:
...
{{7*XC, GENY(3), 45*XC, 0}, Text, TEXTID_Owner, ON, 0,
TXT_TextStreet, "dbaccess=\"property.owner\""},
...
or
DItem_TextRsc TEXTID_Owner=
{
64, "%s", "%s", "", "", NOMASK, 0, TXT_TextOwner, ""
}
extendedAttributes
{
{
{EXTATTR_DBACCESS, "property.owner"},
}
};
Parameters
[in]ownerMDwho will own task of dialog
Remarks
The extended attribute, EXTATTR_DBPAGENUMBER specifies the page number where the item should appear on the database form.
Parameters
[in]primaryTableNamespecifies the primary table name for which the database form is opened.
[in]dbQueryStrPspecifies the SELECT statement to be executed when the database form comes up if executeQuery is true.
[in]executeQuerytrue to execute at open
[in]optionsspecifies various attributes for the database form. Default is 0L. Currently only one attribute is supported.
Remarks
Constant Description DBDIALOGATTR_CURSORBASED Use the native Database Cursor based form instead of the default key array based. Cursor based form does not support the Previous record feature or displaying record Counts.
Returns
A pointer to the opened Dialog Box. NULL is returned if the Dialog Box resource was not found or database server is not active or primary table name is not valid or errors occurred while loading the items contained in the Dialog Box.
See also
mdlDBDialog_openForm mdlDBDialog_openFormFromElement
Remarks
Required Library: mdlbltin.lib

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.