Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add new fields to a table withVB

Status
Not open for further replies.

Tfrank

Technical User
Jun 19, 2001
30
0
0
US
I have have an Access 97 database that is split into a two files (back-end and front-end). The data base is used by several different groups each with their own data and all stand alone systems. I have made an enhancment to the database where I have added more fields in one of the tables. I would like to add some VB code in the front end database that will check the backend for the new fields and add them if they are not there. I need to have the ability to upgrade the database without replacing the database where all the data would have to be re-entered. Any help on how to write the VB code to automatically add new fields in an existing table would be greatly appreciated so all I need to do is send out a new front end file.

Thanks,
Tfrank
 
Tfrank,
Not sure how to examine the back-end database for new fields through code. There are proably about 20 different ways to do it. But I think that you can add fields to a given table through code.. search your help file for the 'ALTER TABLE Statement'.

STraight from the help file:

ALTER TABLE table {ADD {COLUMN field type[(size)] [NOT NULL] [CONSTRAINT index] |
CONSTRAINT multifieldindex} |
DROP {COLUMN field I CONSTRAINT indexname} }

Just a little nudge in the right direction for you.

-Josh ------------------
-JPeters
Got a helpful tip for Access Users? Check out and contribute to 'How to Keep Your Databases from becoming Overwhelming!'
thread181-293590
jpeters@guidemail.com
------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top