Database Column Names

Results 1 to 2 of 2

Thread: Database Column Names

  1. #1
    Join Date
    Dec 1969

    Default Database Column Names

    Hi Guys!,<BR><BR>I have several tables with different columns representing different data. What these columns have in common at best is that if that data exists a value of "Yes " is attributed. I would was wondering that how can I list the names of the columns that have the value Yes.<BR><BR>e.g. The user selects product X with ProductID = 1. The Products table has 15 columns with the values "Yes". How do I retrieve the names of these columns?<BR><BR>Thanks!!

  2. #2
    Join Date
    Dec 1969

    Default RE: Database Column Names

    &#060;%<BR>SQL = "SELECT * FROM products WHERE productID = " & whatever<BR><BR>Set RS = yourConnection.Execute( SQL )<BR>For fnum = 0 TO RS.Fields.Count-1<BR> Set fld = RS.Fields(fnum)<BR> If fld.Type = 11 Then &#039; 11 is adBoolean if you use<BR> If fld.Value = True Then <BR> Response.Write "&#060;LI&#062;" & fld.Name & vbNewLine<BR> End If<BR> End If<BR>Next<BR>...<BR>%&#062;<BR><BR>This *ASSUMES* that you are (A) using Access, (B) those fields are declared as Yes/No fields [which are *really* boolean fields].<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