Results 1 to 3 of 3
  1. #1
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts

    VB6 to ACCESS - Changing Required Field Property (VB6 and ACCESS 2000)

    I am attempting to ADD a new field to a table from a small VB6 application
    I am using ADODB and ADOX to open the Table(s) and add the field.
    Everything works fine except for the
    REQUIRED property
    which is always set to Yes
    I need this to be set to No for the added field.

    Is this possible using ADODB and/or ADOX?
    If so How? Please!

    I know I can do it using DAO, but I want to use ADO

    Anyone help ?
    Thanks if you can.
    Andrew

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: VB6 to ACCESS - Changing Required Field Property (VB6 and ACCESS 2000)

    This is from a book, as I haven't tried to do what you're doing. Does this do it?

    myColumn.Attributes = adColNullable 'indicate that the column may contain Null values

    Note that the Attributes property also stores information about whether the column is a fixed width. If you need both set, you use the Or operator:

    myColumn.Attributes = adColNullable Or adColFixed

    Source: David Sussman, ADO 2.6 Programmer's Reference, p296 (Wrox Press 2000).

  3. #3
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: VB6 to ACCESS - Changing Required Field Property (VB6 and ACCESS 2000)

    You beauty! <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

    Absolutely spot on.
    Thank you very much

    Andrew
    Andrew

Posting Permissions

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