• VB6 to ACCESS – Changing Required Field Property (VB6 and ACCESS 2000)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » VB6 to ACCESS – Changing Required Field Property (VB6 and ACCESS 2000)

    Author
    Topic
    #385107

    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.

    Viewing 0 reply threads
    Author
    Replies
    • #663182

      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).

    Viewing 0 reply threads
    Reply To: VB6 to ACCESS – Changing Required Field Property (VB6 and ACCESS 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: