Cicode Programming Reference > Cicode Function Categories > Device Functions Introduction > DevOpenGrp


Opens a group of devices.


DevOpenGrp(hGrp [, nMode] )


The handle to a database containing a group of devices.


The mode of the open:

0 - Open the device in shared mode - the default mode when opening a device.

1 - Open the device in exclusive mode. In this mode only one user can have the device open. The open will return an error if another user has the device open in shared or exclusive mode.

2 - Open the device in indexed mode. In this mode the device will be accessed in index order. This mode is only valid if the device is a database device and has an index configured in the Header field at the Devices form. Please be aware that specifying mode 2 when opening an ASCII device is ignored internally.

4 - Open the device in 'SQL not select' mode. If opened in this mode, you need to not attempt to read from an SQL device.

8 - Open the device in logging mode. In this mode the history files will be created automatically.

16 - Open the device in read only mode. In this mode data can be viewed, but not written. This mode is supported only by DBF and ASCII files - it is ignored by printers and SQL/ODBC databases.

Return Value

Returns 0 if successful or -1 if the function is provided with a bad handle and cannot open the group.

Related Functions

DevClose, DevOpen