Solved

Modify backend table with new field

Posted on 2016-07-26
4
58 Views
Last Modified: 2016-07-28
Environment Desktop Access 2013 database with front end and backend (standard).
When starting, a bat file copies a master FE to a temp area and then executes the FE from the temp area.
I have a number of different sites, each with their own separate network, the same copy of the FE and their own BE.
The BEs are structurally the same.
Problem: I need to add a field to the standard BE.
Normally, I put a new version of the FE to the various sites,  the FE software checks the version of the BE and if neccessary manipulates it so the BE is compatible with the new FE version.  For example, I can add a new table to the BE from a deployed FE.
The question is  - how do I code it so that it adds a field to a backend table.  I know how to do that for adding a field to a database but not when the table is linked.  Any ideas.
0
Comment
Question by:Keyboard Cowboy
  • 2
  • 2
4 Comments
 
LVL 39

Expert Comment

by:als315
ID: 41729735
You can delete link, modify table, link again
0
 

Author Comment

by:Keyboard Cowboy
ID: 41729746
HOw do I modify the table while executing in the Front End.  Basically, how do I execute in one database and modify the structure of a  table (add a field) in another database.
Do you have any sort of code sample which does this?
0
 
LVL 39

Accepted Solution

by:
als315 earned 500 total points
ID: 41729753
You can use this code (correct names):
Dim dbs As DAO.Database
Set dbs = DBEngine.Workspaces(0).OpenDatabase("C:\Somepath\DBName.accdb")
dbs.Execute ("ALTER TABLE YourTableName ADD COLUMN FieldName Text(25)")

Open in new window

1
 

Author Comment

by:Keyboard Cowboy
ID: 41733184
Thanks - works like a charm.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Modern/Metro styled message box and input box that directly can replace MsgBox() and InputBox()in Microsoft Access 2013 and later. Also included is a preconfigured error box to be used in error handling.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question