[AccessD] SQL versus ADO for setting default value

Susan Harkins ssharkins at gmail.com
Tue Jan 20 11:47:15 CST 2009


I tried using a purely SQL solution to add a column and set its default 
value to a table:

strSQL = "ALTER TABLE tblCustomerLabels " _
   & "ADD COLUMN LabelTotal Integer DEFAULT 0"
DoCmd.RunSQL strSQL

I tried both DEFAULT and SET DEFAULT. Neither works -- is this one of those 
obscure SQL holes that's going to force me to create an ADO connection? I 
won't use that connection for anything else, so if there's a SQL solution 
and I've just got the syntax wrong, please let me know. I'd rather avoid the 
ADO connection if possible.

Susan H. 




More information about the AccessD mailing list