Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / July 2005

Tip: Looking for answers? Try searching our database.

Alter table command in SQL Server

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Madhuri - 12 Jul 2005 17:04 GMT
Hi all

If I want to add a field to an existing table in msaccess while a button on
a form is clicked
how do I execute the equivalent of

alter table xyz add fields(abc text(12))

Thanks
Madhuri
Ron Weiner - 12 Jul 2005 17:35 GMT
Try

CurrentProject.Connection.Execute "ALTER TABLE xyz ADD COLUMN abc CHAR(12)"

Watch for Newsreader wrap, the above should all be on one line

Ron W
> Hi all
>
[quoted text clipped - 6 lines]
> Thanks
> Madhuri
Ron Weiner - 12 Jul 2005 17:43 GMT
UtOh!!

I just reread the original post.  If you want to alter a table on Sql Server
my previous post will not do it.  In fact I am not even sure it can be done
from Access.  It may be possible to create a pass thru query with the Sql
DDL syntax, but again I have never attempted this.

The code in my previous post will only work when the table you are modifying
is in the same database as the code.

Sorry for any confussion I may have created.

Rom W
> Try
>
[quoted text clipped - 14 lines]
> > Thanks
> > Madhuri
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.