Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Access2000 Required Field Property

Status
Not open for further replies.

Michael42

Programmer
Oct 8, 2001
1,454
US
Is there any way from ASP to use the Access 2000 required field property set in the database?

Thanks,

Michael
 
I think I figured it out (see below):

Dim i, sAttributes
sAttributes = " "
Response.Write &quot;<table border=1 cellpadding=2 cellspacing=2>&quot; & vbNewLIne
Response.Write &quot;<tr bgcolor=#eeeeee><td>Name</td><td>Type</td><td>Size</td><td>Attributes</td></tr>&quot; & vbNewLine

Response.Write &quot;<tr>&quot; & vbNewLine
For i = 0 To oRS.Fields.Count-1
Response.Write &quot;<td>&quot; & oRS.Fields(i).Name & &quot;</td>&quot; & vbNewLine
Response.Write &quot;<td>&quot; & oRS.Fields(i).Type & &quot;</td>&quot; & vbNewLine
Response.Write &quot;<td>&quot; & oRS.Fields(i).DefinedSize & &quot;</td>&quot; & vbNewLine

Response.Write &quot;<td><font size=2>&quot;
If ( oRS.Fields(i).Attributes AND adFldKeyColumn) then Response.Write &quot;adFldKeyColumn<br>&quot;
If ( oRS.Fields(i).Attributes AND adFldUpdatable) then Response.Write &quot;adFldUpdatable<br>&quot;
If ( oRS.Fields(i).Attributes AND adFldUnknownUpdatable ) then Response.Write &quot;adFldUnknownUpdatable<br>&quot;
'Required
If ( oRS.Fields(i).Attributes AND adFldIsNullable ) then
Response.Write &quot;Not Required<br>&quot;
else
if ( oRS.Fields(i).Type <> 11) then
Response.Write &quot;<b>Required</b><br>&quot;
else
Response.Write &quot;Not Required<br>&quot;
end if
end if
If ( oRS.Fields(i).Attributes AND adFldRowID ) then Response.Write &quot;adFldRowID<br>&quot;



Response.Write &quot;</font></td>&quot; & vbNewLine

Response.Write &quot;</tr>&quot; & vbNewLine
Next Michael
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top