Hello
I need to add a field to a Access database from a VisualBasic code
(and delete one field)
Can anyone advice on this ??
Thanks
Printable View
Hello
I need to add a field to a Access database from a VisualBasic code
(and delete one field)
Can anyone advice on this ??
Thanks
if you use DAO to access your jet database, check out the TableDefs collection.
sample
Dim db as DAO.Database
set db = OpenDatabase("m:\daten\projekt\test.mdb")
Dim td as DAO.TableDef
set td = db.TableDefs("test2")
td.fields.remove("PK") ' remove
' add new fields
Dim fld as DAO.Field
set fld = td.createField("pk", dbLong)
fld.attributes = dbAutoIncrField
td.fields.append