The purpose of DB Class Generator is to quickly and simply generate classes and optionally collections that map to tables in a selected SQL Server database.
DB Class Generator
First select a DSN from the 'DSNs' DropDown. The 'Username' and 'Password' are defaulted from DB Class Generator Options. If the login details are correct the tables of the database will be listed in the 'Tables' DropDown. 'Create Collections' is also defaulted via the options screen. If selected a collection will also be created.
Each time a different table is selected in the 'Tables' DropDown the items below will be updated. 'Class Name' is defaulted to 'cls' and the table name, with any prefix for the table removed and any 's' on the end being dropped. The prefix being any lower case letters before the first upper case letter. For example, Table 'tblAuthors' will become 'clsAuthor'.
The prefix for the collection is taken from Variables Prefixes in General Options.
Next is a ListView that lists all the columns in the table. Each row has the following information: -
The Frame underneath displays information on the currently selected column. You can change the name and type of the property that will be created for the column. You can also change whether a column has a default value and its associated value. By default all columns are selected for inclusion in the class, if any are unnecessary simply uncheck them. Click 'Update' to save any changes to the ListView.
To create the class, and collection if selected, click 'Create'. If the project is a new one and hasn't been saved yet the objects will be saved to the VB install location, otherwise they will be saved in the .vbp file location.
Note: Only MS SQL Server databases are currently supported.