According to w3schools I can set default value in MS Access this way:
ALTER TABLE Persons
ALTER COLUMN City SET DEFAULT 'SANDNES'
But this variant gives me
"Syntax error in ALTER TABLE instruction".
Also doesn't work:
"SANDNES"
(SANDNES)
I'm confused about that. My City Column hasn't any constraints or dependencies.
MS Access 2007. What i'm doing wrong ?
What important to mention: I should use SQL VIEW inside MS Access to set default value
CurrentProject.Connectionis an ADO Connection, and your statement can be executed without error like this:CurrentProject.Connection.Execute "ALTER TABLE Persons ALTER COLUMN City SET DEFAULT 'SANDNES'"CurrentProject.Connection.Execute "ALTER TABLE Persons ALTER COLUMN City SET DEFAULT ""SANDNES"""SET DEFAULTis only supported when executed from ADO. When you execute your query from SQL View, you are not using ADO ... so you get that syntax error.