[AccessD] Alter table

jwcolby jwcolby at colbyconsulting.com
Tue Feb 26 12:52:16 CST 2008


That was my next thing to try.

Thanks, 


John W. Colby
Colby Consulting
www.ColbyConsulting.com 
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Steve Schapel
Sent: Tuesday, February 26, 2008 1:18 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Alter table

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
> 
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list