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;

  1. 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:
      1. 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);
      }
      
  2. Constructing a CNyfDb object with path to a .nyf database file.

    • Prototype: CNyfDb(sDbPath, bReadonly);
    • Parameters:
      1. sDbPath, path to a .nyf database file.
      2. 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);
      }