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!

Check existence of field in Access Database

Status
Not open for further replies.

chris921

Technical User
Mar 9, 2004
82
0
0
GB
Hi - I've got a VB6 program which runs with a database back-end.

I would like to implement a module that checks for the existence of fields in the database, and if they're not there, create them using a simple SQL query.

The creation of the fields is easy, however I'm struggling on how to check whether they already exist or not?

If there's anyway that someone can tell me how to do this I'd be greatful!

Many thanks

Chris
 
Open a recordset with the table.
Check the names of all fields in a loop.
If the field with the name that you supply exists, leave it as it is, else trigger the creation of field algo.

------------------------------------------
The faulty interface lies between the chair and the keyboard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top