Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Jan 2001
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ADO To Change AllowZeroLength Property of Table Fi

    ADO To Change AllowZeroLength Property of Table Field


    I have the ADO Programmer's Reference by David Sussman and am not yet able to make sense of it all; can someone flesh out the code that i need to alter the AllowZeroLength property of a table field? I have read about the table object, but how do i get to its field properties?

    Thank you!
    --llyal

  2. #2
    Star Lounger
    Join Date
    Dec 2000
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ADO To Change AllowZeroLength Property of Table Fi

    I think you need ADOX to do this. (Or you could just use DAO.)

    Basically the syntax would go something like this:
    Recordset1.Fields("FieldName").AllowZeroLength = True/False

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: ADO To Change AllowZeroLength Property of Table Fi

    DAO is designed to work with Access/Jet objects. ADO is designed to work with data from any compliant ODBC or OLEDB provider, which is why the two object models are so different. DAO is optimzed for Jet, so don't ignore it even if Access 2000 does default to ADO as an object model.

    If you want to manipulate table properties in an Access database, definitely use DAO. It will be much faster and easier than struggling with ADO to do something it wasn't designed to do. The properties exposed through ADO depend on the provider, and even if you can find the properties of the Table object (which is in the ADOX library, BTW), you may not find the one you want.

    Just remember, if you have references set to both ADO and DAO, you have to specify the object library when you declare objects like DAO.Recordset and ADODB.Property and so forth. Otherwise, your code may or may not compile, but it's virtually guaranteed to throw some very strange errors.
    Charlotte

  4. #4
    Star Lounger
    Join Date
    Jan 2001
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ADO To Change AllowZeroLength Property of Table Fi

    To All,

    Thanks for the clarification. I see that DAO is not dead.

    --Llyal

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: ADO To Change AllowZeroLength Property of Table Fi

    Not quite, but it's on its last legs, so definitely learn ADO because that will be the object model going forward. Of course, Office.Net will use ADO.Net, and it isn't quite the same as ADO either. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>
    Charlotte

Posting Permissions

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