How can I set up attributes for an autonumber field
I did like this but no work
with rstNew
.Fields .CreateField("Field1", dbLong)
Field1.Attributes = dbAutoIncrfield
End With
Thsi field suppose to be indexed
Printable View
How can I set up attributes for an autonumber field
I did like this but no work
with rstNew
.Fields .CreateField("Field1", dbLong)
Field1.Attributes = dbAutoIncrfield
End With
Thsi field suppose to be indexed
VB Code:
set NewTable = DB.OpenRecordset("test") With NewTable .Fields.Append .CreateField("Field1", dbLong) .Fields("Field1").Attributes = 17 end with
Using Sql:
VB Code:
Dim sCmd as String sCmd = "ALTER TABLE [" & TABLENAME & "] ADD COLUMN DBCreatorID INT IDENTITY CONSTRAINT IdxDBCreatorID PRIMARY KEY" DBcn.Execute sCmd
thanks MXnMX,
This came in really handy as I was searching for this subject and came across this post - worked perfectly !!
-AC :thumb: