Setting new table
In the created database it is good to start with tables because without them the database does not make sense. In previous article you could read how to set up a new database. Now we look at the creation of tables, working again with version 2010. Access is not limited by number of rows in a table, but you can only use max. 255 columns. This number is logical, because with relations it is rather trying to create smaller tables that can then connect each other. This ensures that there are no unnecessary duplicates and subsequent treatment is more effective.
The recently formed a new Access database, it will offer a new table that we can use. Thus formed table is located in the so-called Datasheet view. To modify tables there are available two contextual tabs Fields and Table. They can be used to create new columns and set their attributes. If this table you do not want to use, just close it with a cross in the top right corner and do not save changes.
For our purposes we set a new table.
New table
We create a new table on Create tab.
- Table … creates a table similar to the one that opened after the establishment of a new database
- Table design … creates the table and goes straight to Design view
Design view is also available in older versions. To view the structure and setting fields it seems to me clearer than the Datasheet view.
In the field Name column, we define field names.
In the column Data type we specify the kind of values that we want in the cells of this array. It is necessary that the database table needs to have in every cell of the column value of the same type, eg. number, text or dates. It’s also important for subsequent linking tables or creating calculations.
In the Description column can be optionally detailed description of the column that serves rather to understand the content of field for the user or for creating documentation of the database.
Save the table
Object designs should always be saved. The quickest way is to use a small floppy disk icon on the Quick Access Toolbar on, or in File> Save Object As. Table name may have a maximum of 64 characters and can not contain any special symbols. It’s good to get used appropriately naming objects and this procedure applied to the entire database. Example of names may be tbl_Orders or tblOrders etc.
If you do not set a column as unique so-called primary key before saving, Access asks when saving, whether you want to set it. If not set, but the table contains a field with the type AutoNumber, it will place the key to it. If such does not, the Access itself creates column of the table in the first place and calls it ID. But one can not set the key, and when asked to do select the option that you want to create.
After saving the data in the table you can switch the view by selecting Home> View > Datasheet and begin to fill the cell values.
Zanechat komentář