Steve Schapel
miscellany at mvps.org
Tue Feb 26 12:18:05 CST 2008
John, No, that won't work. But you can do it like this: Dim dbs AS Database Set dbs = OpenDatabase("<your backend>") dbs.Execute "ALTER TABLE ... ADD COLUMN ..." dbs.Close Regards Steve jwcolby wrote: > Is it possible to use the "IN databasename" syntax in an ALTER TABLE SQL > statement in Access? > > I have written code to dynamically alter a table (add a field of a given > type) in an Access database table. I wanted to do that so that I could have > my code "slip in" new fields in the brief periods that a table is not in > use, rather than have to wait until the evening to get the table into the > table. It seems to work if executed directly in the BE itself but I get a > SQL syntax error if I try to use the "IN DatabaseName" stuff from another > FE. > > John W. Colby > Colby Consulting > www.ColbyConsulting.com >