Results 1 to 2 of 2

Thread: How to create a field type

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 1999
    Location
    Rijswijk, Holland
    Posts
    25

    Post

    Hello dear VB programmers,

    I made the following line
    With tdfNew
    .Fields.Append .CreateField("Plant", dbText)
    End With

    How can I create a primary key in this line.
    Where can I find other types (Autonumber / YesNO / etc) in the help of VB5

    Nice greetings

    Ingrid.

  2. #2
    Addicted Member
    Join Date
    Oct 1999
    Posts
    232

    Post

    Try it:

    ------------------
    Dim Idx As Index

    Set Idx = tdfNew.CreateIndex("PrimaryKey")

    With Idx
    .Primary = True
    .Required = True
    .Ignorenulls = False
    .Fields.Append .CreateField("Field1")
    End With

    tdfNew.Indexes.Append Idx
    tdfNew.Indexes.Refresh

    ------------------
    smalig
    smalig@hotmail.com
    smalig.tripod.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width