CNyfDb's Constructor
There're two methods to construct an object of the CNyfDb class from either a position number or a .nyf file path;
Constructing a CNyfDb object from a position number of a .nyf database opened and listed on the database Tab control in the main window.
- Prototype: CNyfDb(iDbPos);
- Parameters:
- iDbPos, a position number (0-based) of a .nyf database opened and listed on the database Tab control in the main window. Defaults to (-1), which stands for the currently working database.
- Return Value: an object of the CNyfDb class.
- Example:
try{ var nyf=new CNyfDb(-1); //-1: for the current one; alert(nyf.getDbFile()); }catch(e){ alert(e); }
Constructing a CNyfDb object with path to a .nyf database file.
- Prototype: CNyfDb(sDbPath, bReadonly);
- Parameters:
- sDbPath, path to a .nyf database file.
- bReadonly, determines if or not to open the database as Readonly.
- Return Value: an object of the CNyfDb class.
- Example:
try{ var nyf=new CNyfDb('/home/username/test/1.nyf', true, 0); alert(nyf.getDbFile()); }catch(e){ alert(e); }