-
Hello dear VB users,
Can somebody tell me how set to the field "NewField" to a primairy key:
Set Ws = DBEngine.Workspaces(0)
Set Db = Ws.CreateDatabase(DbSettings, dbLangGeneral)
Dim tdfNew As TableDef
Set tdfNew = Db.CreateTableDef("newTable")
tdfNew.Fields.Append tdfNew.CreateField("NewField", dbText)
tdfNew.Fields("newfield").DefaultValue = "new"
Db.TableDefs.Append tdfNew
Db.Close
Nice greetings,
Michelle.
-
try something like:
Field.Attributes(dbAutoIncrField) = TRUE/1/YES (one of those)
Check out the FieldAttributeEnum enumeration in the object browser for other values you can use
-
Following SQL should work in SQL Server:
Alter table newtable add constraint pk_Newfield PRIMARY KEY newfield
[This message has been edited by JHausmann (edited 02-07-2000).]