A column is nullable if its Required property is False:
Currentdb.TableDefs("MyTable").Fields("MyField").R equired
To see if it can accept a zero-length string:
Currentdb.TableDefs("MyTable").Fields("MyField").A llowZeroLength
Other contraints are stored in the Indexes of the table. For example the
Primary Key has its Primary property True:
Currentdb.TableDefs("MyTable").Indexes(0).Primary
For an example of looping through the Fields of the TableDef, listing names
and examining a property (Description in this case), see:
http://allenbrowne.com/func-06.html
For a utility that examines an Access database and identifies tables that
lack a primary key, foreign keys are that nullable, and so on, see
Database Issue Checker Utility
at:
http://allenbrowne.com/AppIssueChecker.html
The code might be informative if you are seeking to programmatically examine
the structure of a database.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
<sr*******@gmail.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
how do i get the constraints associated with a table. is there any
system table which stores the constraint details. Atleast how do I know
if a column is nullable or not