Check if a field is already there

3 posts / 0 new
Last post
Steve
Offline
Joined: 02/04/2014 - 11:25
Check if a field is already there

Hi everyone,
 
is there any way to check whether a field is already contained in a database?
I want to check if a field is there and if not it appends the field. I tried table.getField, but this results in an error.
 
Here is the part of my code I mean:
Dim table As table
Dim field As field Set db = Client.OpenDatabase (dbname)
Set task = db.TableManagement
Set table = db.TableDef
 
Set field = table.getField("DUMMY_NAME") - This will result in an error if the field is not there
...
 
Thanks,
Steve

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi Steve, I already have something on the site for this.  Check out my post here.

Steve
Offline
Joined: 02/04/2014 - 11:25

Thanks