
09-01-2000, 09:51 AM
|
|
|
Re: adding fields
|
Here's code that will add a field to an Access .MDB file using Jet/DAO:
' Assume that Db is an open database and that you're adding
' fields to the "System" table.......
Dim Td As TableDef
Dim F As Field
Set Td = Db.TableDefs("System")
' Add a Text field
Set F = Td.CreateField("NewTextField", dbText, 25)
F.AllowZeroLength = True
Td.Fields.Append F
' Add a Boolean field
Set F = Td.CreateField("NewBooleanField", dbBoolean, 0)
Td.Fields.Append F
Td.Close
Helmar B. Herman, VP ProtoProducts
|
|