I have a client who needs to configure an old Visual Basic 5 application that uses an Access 97 and Jet 3.5 database as the database engine.
The required setup requires adding a column to an existing table. The following works great:
strSQL = "ALTER TABLE Users ADD COLUMN Status BYTE" pdbDatabase.Execute strSQL
However, I would like to set the default value (i.e. 0 or 1) for the new column. I tried the following and several options:
strSQL = "ALTER TABLE Users ADD COLUMN Status BYTE DEFAULT 1"
But all of them lead to an error: "Syntax error in the expression ALTER TABLE (3293)"
While investigating this problem, I saw some information that is not consistent with the DEFAULT clause, which is not supported in my legacy Access 97 and Jet 3.5 configuration.
Can someone confirm this or point me in the right direction to make this work?
Thank you for your help.
source share