Create and delete tables in an Access database with SQL statements; Add columns and delete columns posted on2009-08-11 13:42 Yunbo Read (1240) Comments (0) Edit Collection
Create and delete tables in an Access database with SQL statements; Add columns and delete columns
SQL statements, see Help for specific use methods
Create Table tab1 (Fld1 integer)
Drop Table TAB1
Alter Table tab1 Add COLUMN col1 Integer
Alter Table tab1 Drop COLUMN col1
2
Set up a data table
CREATE table data table name (field name 1 data type 1 (data length), Field name 2 data type 2 (data length),...)
Delete a data table
drop table Data table name
Edit Data table
Add Field
ALTER TABLE data table name add field name data type (data length)
Delete a field
ALTER TABLE data table name drop field name
Field renaming
There is no direct rename statement, but can be implemented by first deleting and then adding the method
3
Set up a data table
CREATE table data table name (field name 1 data type 1 (data length), Field name 2 data type 2 (data length),...)
Delete a data table
drop table Data table name
Edit Data table
Add Field
ALTER TABLE data table name add field name data type (data length)
Delete a field
ALTER TABLE data table name drop field name
ALTER TABLE Table1 ADD COLUMN newcol TEXT (Ten) DEFAULT ' ABC
Create and delete tables in an Access database with SQL statements; Add columns and delete columns