4.5 Creating Custom Tables

In order to provide further customization and avoid ODBC tool limitations, you can create custom user tables. User table names start with an underscore. For example, if a table name "_userReport" has been created by the user then a query using it could look like, "Select * from _userReport". All user-defined tables will appear in the lists of tables displayed by tools like MSQuery, Excel, Crystal Reports, etc.

4.5.1 Defining Tables

To define a table:

  1. Open the ODBC Data Source Administrator by clicking Start > Settings > Control Panel, then double-clicking the ODBC Data Source Administrator icon.

  2. Add a new Novell NDS source or configure an existing one. The driver should say "Novell ODBC, Driver for NDS".

  3. Select a Tree and press the "User Defined Tables" button. User Defined tables are based on the schema of an existing tree. If "Use default context" is selected then the schema of your default tree will be used.

  4. Add a new Table, or change and existing one. The default directory is "c:\winnt\odbc". All files with a ".out" extension (Odbc User Table) will listed in the dialog. The "Browse" button can change this directory. Double clicking a table in the list, or selecting a table and clicking "Modify", brings up a dialog to modify that table.

  5. Select attributes for the new table. There are two types of Classes in NDS: Base and Auxiliary Classes. In a user-defined table you can have attributes from only one base class. You can have attributes from many Auxiliary classes. The top half of the dialog is used for Base class attributes, and the bottom for the Auxiliary Attributes.

  6. The left column represents the classes and attributes in the schema and the right side represents the attributes in the user-defined table. All Base Attributes added to the user-defined table will be erased if a new Base Class is selected. However, all Auxiliary attributes remains if a new Auxiliary class is selected.

4.5.2 Where are the User-Defined Tables Stored?

By default User-defined tables are stored in ‘UserDefinedTables' under the installation directory. So a typical default directory would be “c:\novell\odbcnds\userDefinedTables”. The "Browse" button can change this directory. This directory is stored in the Registry under the key, HKEY_CURRENT_USER\Software\Novell\ODBCnds\path.

All files with a ".out" extension (Odbc User Table) will listed as user-defined tables.

4.5.3 Defining Tables from a Text File

The user table is a standard text file. A User defined table should always begin with an underscore and have either an out extension or no extension.

The file format is as follows:

Line 1: Ignored by driver for now. In the future this includes version numbers and tree name.

Line 2: Base Class name.

Line 3 - End: All attributes, auxiliary and base. Column names should not include composite attribute suffixes or concatenation suffixes. NDS_* columns are automatically included in all tables.