Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Modify backend table with new field

Posted on 2016-07-26
4
Medium Priority
?
85 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 40

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 40

Accepted Solution

by:
als315 earned 2000 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

721 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