UtilTableOpen - cDbUpdateFunctionLibrary
To open a table directly without any .int file. This is a driver equivalent version of the "Open As" command.
Type: Function
Parameters: Handle hTable String sTableName Integer iMode
Parameter |
Description |
hTable |
The filelist number. Can be 0 if table doesn't exist in Filelist.cfg |
sTableName |
The root name of the table |
iMode |
DF_SHARE, DF_EXCLUSIVE |
Syntax
Function UtilTableOpen Handle hTable String sTableName Integer iMode Returns Boolean
Call: |
Get UtilTableOpen "MyTable" to bOK |
Description
To Open a table with any driver and anywhere. The table doesn't need to exist in Filelist.cfg, which in case a zero (0) should be passed to the funciton. Note: If the driver is <> DATAFLEX_ID - login credentials are used; it is then assumed that the proper login properties has been setup properly with the cSQLConnections object.
If the open command fails the Err flag will be reset to false, at the end of the function. The found flag is still used to indicate if the open was successful or not. The function returns a True if successful (table could be opened).
Using the "Open As" syntax with drivers means that we don't need to rely on .int file settings. This is good because with DFConnectionID's those credentials doesn't need to be available in the .int file (and probably aren't). As long as the login properties of this object have been set properly we can open the table.
Example
Procedure OnClick
Boolean bOK
Get UtilTableOpen "OrdHea2" to bOK
End_Procedure