ADO Field Properties

Results 1 to 2 of 2

Thread: ADO Field Properties

  1. #1
    Join Date
    Dec 1969

    Default ADO Field Properties

    I am using MS-Access database. I am able to retrieve name,type and defined size of every field in a table by using field object of ADO in an asp page. Is there anyway to determine whether a field is a Primary key or not and required or not. Any help would be greatly appreciated.<BR><BR>Thanks in advance

  2. #2
    Join Date
    Dec 1969

    Default RE: ADO Field Properties

    ADODB recordsets have a Fields collection, and each field has properties like Name, DefinedSize, Type, and Attributes, which is a combination of some enums.<BR><BR>strName = MyRS.Fields("MyColumn").Name &#039; returns "MyColumn" of course...<BR>intSize = MyRS.Fields("MyColumn").DefinedSize<BR>intType = MyRS.Fields("MyColumn").Type<BR>blnIsPramaryKey = cBool((MyRS.Fields("MyColumn").Attributes OR adFldKeyColumn))<BR><BR>See here:<BR>

Posting Permissions

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