|
-
May 27th, 2000, 01:17 AM
#1
Thread Starter
Hyperactive Member
OK got a question you can create fields like so:
Set tdftable = dbsData.CreateTableDef("Vocab")
With tdftable
.Fields.Append .CreateField("Word", dbText)
.Fields.Append .CreateField("Def", dbText)
End With
dbsData.TableDefs.Append tdftable
Now in the database there is a way to create it with that autonumber function. How can you do that in code.
I thought it would be something like this
Set tdftable = dbsData.CreateTableDef("Vocab")
With tdftable
.Fields.Append .CreateField("ID", dbautonumber)
.Fields.Append .CreateField("Word", dbText)
.Fields.Append .CreateField("Def", dbText)
End With
dbsData.TableDefs.Append tdftable
but thats no good. thanks
-
May 27th, 2000, 03:34 AM
#2
I don't know if there is way to do this with the CreateField method, but there is a way to do it with an embedded SQL statement (using the Database object's Execute method). You could do this:
dbsData.Execute _
"CREATE TABLE Vocab (ID AUTOINCREMENT, Word TEXT, Def TEXT)"
-
May 27th, 2000, 03:48 AM
#3
Thread Starter
Hyperactive Member
Thanks!! It Works Great!!!
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
|