Re: Recognize NOT NULL field in Access 2003




Is there a way to recognize either a field is marked as NOT NULL (required
field) or not in Access 2003?

I already tried to use the REQUIRED property in TField, but it seems to
operate inside the application only. It doesn't really reflects what's set
in the database.

I'm using TADOConnection and TADOTable to open these tables.

First there is no Access 2003 in ADO. Access has not updated the database
format since version 2000.
You can find out the required property of a field using the
AdoConnection.OpenSchema method
ADOConnection1.OpenSchema(siColumns
,VarArrayOf([Unassigned,Unassigned,'Customers',Unassigned]),EmptyParam,ADODataSet1)

How ever Access also has an "Allow Zero length" property for fields.
This is not a standard ADO property so the only way to find out how it is set is
to use ADOX
To use ADOX you need to import the Microsoft ADOX type library
--
Brian Bushay (TeamB)
Bbushay@xxxxxxxxx
.



Relevant Pages

  • Re: "If ......Exists.... Then Run SQL code"
    ... Thankyou both for the useful information, ... "Jamie Collins" wrote: ... that just tries to set the Required property of a ... So on closer examination, neither are suspected ADOX ...
    (microsoft.public.access.modulesdaovba)
  • Re: creating new database by clicking the menu item
    ... ur code helped me a lot but i have one problem i.e database and tables are ... created but i want to store data in some fields only then i am getting this ... Error Message: the field 'new_custdetails.saluatation' cannot contain a ... null value because the required property for this field is set to true. ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Recognize NOT NULL field in Access 2003
    ... I already tried to use the REQUIRED property in TField, ... in the database. ... I'm using TADOConnection and TADOTable to open these tables. ...
    (borland.public.delphi.database.ado)