Results 1 to 3 of 3

Thread: Default Field Values

  1. #1

    Thread Starter
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796

    Unhappy

    With SQL database and using ADO, is there anyway to access in VB, the default values of particular fields in the database?

    The field object of a recordset doesn't seem to have a 'defaultvalue' property and ADOX seems to have the same limitation.

    Any ideas attall would be appreciated?

    Simon.

  2. #2

    Wink TableDef

    Simonm,
    It is actually straightforward. Code ....


    Dim tbldefs As TableDef

    Set tbldefs = dbs.TableDefs!<table name>
    With tbldefs
    c = .Fields(0).Size
    End With
    msg=msgbox(c)


    ___________

  3. #3

    Thread Starter
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796

    Red face Unfortunately...

    That's not quite what I'm looking for.

    Firstly, ADO doesn't have 'Tabledef' objects.

    Secondly, I want the 'DEFAULT VLAUE' and not the 'SIZE' property of the field.

    Thanks anyway.

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