|
-
Feb 4th, 2000, 10:12 PM
#1
Thread Starter
Hyperactive Member
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.
-
Feb 6th, 2000, 07:21 AM
#2
Guru
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
-
Feb 6th, 2000, 12:20 PM
#3
Frenzied Member
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).]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|