ALTER Access Database

Today I learned how to change the design of a table in Access without opening the database file in Access and overwriting the file. This is necessary if you are using an Access database on a web site where a file overwrite could cause you to accidentally lose some recently entered data.

The syntax for the SQL statement to add columns to a table is:

ALTER TABLE tblName ADD COLUMN colName TEXT(255) NULL;

The trick is that you must use the NULL keyward to make the column nullable or the statement will fail.

This entry was posted in General. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit exceeded. Please complete the captcha once again.