SQL to add column with default value - Access 2003

前端 未结 5 1370
悲&欢浪女
悲&欢浪女 2020-11-30 12:59

Updating an old ASP/Access site for a client - I need SQL to add a column to an existing table and set a default value. Doesn\'t work - any ideas?

This works fine

5条回答
  •  余生分开走
    2020-11-30 13:37

    With ADO, you can execute a DDL statement to create a field and set its default value.

    CurrentProject.Connection.Execute _
       "ALTER TABLE discardme ADD COLUMN membersOnly SHORT DEFAULT 0"
    

提交回复
热议问题