To create a database using Visual Basic:
- Start Visual Basic
- Click on "Add-Ins"
- Click on "Visual Data Manager..."
- A new window title "VisData" will appear.
- Click on "File"
- Click on "New..."
- Click on "Microsoft Access"
- Click on "Version 7.0 MDB..."
- Choose a folder for the database
- Type in a name for the database
- Click on the "Save" button.
You will now see two windows, one titled "Database Window" and the
other titled "SQL Statement". Close the window titled "SQL
Statement".
For each table in your paper diagram:
- Right-click on the word "Properties" in the tree of the Database
Window.
- Click on "New Table"
- A new window titled "Table Structure" will appear.
- Enter a table name
- For each field in the table:
- Click on "Add Field"
- Enter a name
- Select a data type. General rule of thumb: Only make it a
number if the field contains a value that you will be doing a calculation
on. Example: A zip code is a 5-digit number, but the data type
should be text because we don't do any arithmetic on the zip code. The
exception to this rule of thumb is if the field is a foreign key - in which
case the data type should be a number of type long (because auto-number
fields are usually of type long).
- Click on "OK"
- Click on "Add Index"
- Type in a name for the index, usually "Primary Key" is
sufficient and descriptive.
- Click once on the id field from the list.
- Click "OK"
- Click "Close"
- Click on "Build the table"
- The window will close and the table will appear in the tree.