Field attributes and enum values from ADOVBS.INC

Results 1 to 2 of 2

Thread: Field attributes and enum values from ADOVBS.INC

  1. #1
    AirFax Guest

    Default Field attributes and enum values from ADOVBS.INC

    Hi I am kind of starving for efficient ways to manipulate ADO Recordsets with VBS in my ASP pages. Precisely, I would like to know when a field or column is the table&#039s primary key. MS suggests to use the FieldAttributeEnum Values from the ADOVBS.INC file this way : <BR><BR>If CBool(objField.attributes and (sum of attrib values)) then...<BR><BR>It works fine with &#039adFldIsNullable&#039 to know wether a field can be null or not. But none of the other 15 values will work for me. Are there other ways to do this ? Or am I just not doing it right ?

  2. #2
    Join Date
    Dec 1969

    Default RE: Field attributes and enum values from ADOVBS.I

    Not all ODBC drivers support getting all the listed property information.<BR><BR>Quite possibly, you really are getting all that is available.<BR><BR>Hmmm...but you would *think* that at least the fixed size and primary key bits would be usable. <BR><BR>How are you doing the test? You could avoid the CBool easily enough, of course:<BR><BR>If (RS.Fields(n).Attributes AND &h8000) &#060;&#062; 0 Then primary key...<BR><BR>I used the &h8000 notation just in case there is a goof in code.<BR><BR>***************<BR><BR>I just tested this with an Access97 database and table.<BR><BR>I got Attribute bits (in various fields) for adFldFixed, adFldIsnullable, adFldMayBeNull, and adFldUnknownUpdatable.<BR><BR>So I would *guess* that maybe you are doing something wrong.<BR><BR>DO NOTE, though, that I did *NOT* get adFldKeyColumn even though one of the fields I dumped out was the Primary Key. So I would bet that, with Access, you can&#039t determine if the column is the primary key or not.<BR><BR>What can I say?<BR><BR><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