title: How to assign a default value to a variable?
body: <p>I need to know how to assign a column's default value to a variable.  This code is extracted from a file which allows creation, editing, etc. of any specified table from a list provided by adoxConn. Users can view, edit, search and delete any information within any specified table.</p>
  <p>In the code below, the last line will display the value of a column's default property; however, the variable strCPD (5 lines higher) will never get populated.  I've been using a work-around, using two fields (one with current value simply displayed; and another with an input field to change the value), but it's sloppy and doesn't match the rest of the program.</p>
  <pre><code>        If LCase(Table.Name) = LCase(strTable) Then
              IsThere = &quot;True&quot;
              Response.Write  &quot;&lt;form action=&quot;&quot;admin_db_defs.asp&quot;&quot; method=&quot;&quot;post&quot;&quot;&gt;&quot; &amp; vbNewLine &amp; _
                  &quot;   &lt;input type=&quot;&quot;hidden&quot;&quot; name=&quot;&quot;cedit&quot;&quot; value=&quot;&quot;&quot; &amp; LCase(Table.Name) &amp; &quot;&quot;&quot; /&gt;&quot; &amp; vbNewLine &amp; _
                  &quot;   &lt;input type=&quot;&quot;hidden&quot;&quot; name=&quot;&quot;tname&quot;&quot; value=&quot;&quot;&quot; &amp; Table.Name &amp; &quot;&quot;&quot; /&gt;&quot; &amp; vbNewLine &amp; _
                  &quot;       &lt;table align=&quot;&quot;center&quot;&quot; class=&quot;&quot;tbl&quot;&quot; bgcolor=&quot;&quot;&quot; &amp; strPopupTableColor &amp; &quot;&quot;&quot; cellspacing=&quot;&quot;0&quot;&quot; celllpadding=&quot;&quot;0&quot;&quot; /&gt;&quot; &amp; vbNewLine &amp; _
                  &quot;       &lt;tr&gt;&quot; &amp; vbNewLine &amp; _
                  &quot;           &lt;td align=&quot;&quot;center&quot;&quot;&gt;&lt;h1&gt;&quot; &amp; strTable &amp; &quot;&lt;/h1&gt;&quot; &amp; vbNewLine &amp; _
                  &quot;               &lt;table width=&quot;&quot;100%&quot;&quot; border=&quot;&quot;1&quot;&quot; style=&quot;&quot;border-collapse:collapse;&quot;&quot; cellspacing=&quot;&quot;1&quot;&quot; cellpadding=&quot;&quot;4&quot;&quot;&gt;&quot; &amp; vbNewLine &amp; _
                  &quot;               &lt;tr&gt;&quot; &amp; vbNewLine &amp; _
                  &quot;               &lt;td align=&quot;&quot;center&quot;&quot; bgcolor=&quot;&quot;&quot; &amp; strCategoryCellColor &amp; &quot;&quot;&quot; colspan=&quot;&quot;6&quot;&quot;&gt;&quot; &amp; vbNewLine &amp; _
                  &quot;                           &lt;font color=&quot;&quot;&quot; &amp; strCategoryFontColor &amp; &quot;&quot;&quot; size=&quot;&quot;&quot; &amp; strHeaderFontSize+1 &amp; &quot;&quot;&quot;&gt;&lt;b&gt;Field Definitions&lt;/b&gt;&lt;/font&gt;&quot; &amp; vbNewLine &amp; _
                  &quot;                       &lt;/td&gt;&quot; &amp; vbNewLine &amp; _
                  &quot;                   &lt;/tr&gt;&quot; &amp; vbNewLine &amp;  _
                  &quot;               &lt;tr&gt;&quot; &amp; vbNewLine &amp; _
                  &quot;                 &lt;td align=&quot;&quot;center&quot;&quot; bgcolor=&quot;&quot;&quot; &amp; strHeadCellColor &amp; &quot;&quot;&quot;&gt;&quot; &amp; vbNewLine &amp; _
                  &quot;                           &lt;font color=&quot;&quot;&quot; &amp; strHeadFontColor &amp; &quot;&quot;&quot; size=&quot;&quot;&quot; &amp; strHeaderFontSize &amp; &quot;&quot;&quot;&gt;&lt;b&gt;Name&lt;/b&gt;&lt;/font&gt;&quot; &amp; vbNewLine &amp; _
                  &quot;                       &lt;/td&gt;&quot; &amp; vbNewLine &amp; _
                  &quot;                 &lt;td align=&quot;&quot;center&quot;&quot; bgcolor=&quot;&quot;&quot; &amp; strHeadCellColor &amp; &quot;&quot;&quot;&gt;&quot; &amp; vbNewLine &amp; _
                  &quot;                           &lt;font color=&quot;&quot;&quot; &amp; strHeadFontColor &amp; &quot;&quot;&quot; size=&quot;&quot;&quot; &amp; strHeaderFontSize &amp; &quot;&quot;&quot;&gt;&lt;b&gt;Type&lt;/b&gt;&lt;/font&gt;&quot; &amp; vbNewLine &amp; _
                  &quot;                       &lt;/td&gt;&quot; &amp; vbNewLine &amp; _
                  &quot;                 &lt;td align=&quot;&quot;center&quot;&quot; bgcolor=&quot;&quot;&quot; &amp; strHeadCellColor &amp; &quot;&quot;&quot;&gt;&quot; &amp; vbNewLine &amp; _
                  &quot;                           &lt;font color=&quot;&quot;&quot; &amp; strHeadFontColor &amp; &quot;&quot;&quot; size=&quot;&quot;&quot; &amp; strHeaderFontSize &amp; &quot;&quot;&quot;&gt;&lt;b&gt;Size&lt;/b&gt;&lt;/font&gt;&quot; &amp; vbNewLine &amp; _
                  &quot;                       &lt;/td&gt;&quot; &amp; vbNewLine &amp; _
                  &quot;                 &lt;td align=&quot;&quot;center&quot;&quot; bgcolor=&quot;&quot;&quot; &amp; strHeadCellColor &amp; &quot;&quot;&quot;&gt;&quot; &amp; vbNewLine &amp; _
                  &quot;                           &lt;font color=&quot;&quot;&quot; &amp; strHeadFontColor &amp; &quot;&quot;&quot; size=&quot;&quot;&quot; &amp; strHeaderFontSize &amp; &quot;&quot;&quot;&gt;&lt;b&gt;Allow Null&lt;/b&gt;&lt;/font&gt;&quot; &amp; vbNewLine &amp; _
                  &quot;                       &lt;/td&gt;&quot; &amp; vbNewLine &amp; _
                  &quot;                 &lt;td align=&quot;&quot;center&quot;&quot; bgcolor=&quot;&quot;&quot; &amp; strHeadCellColor &amp; &quot;&quot;&quot;&gt;&quot; &amp; vbNewLine &amp; _
                  &quot;                           &lt;font color=&quot;&quot;&quot; &amp; strHeadFontColor &amp; &quot;&quot;&quot; size=&quot;&quot;&quot; &amp; strHeaderFontSize &amp; &quot;&quot;&quot;&gt;&lt;b&gt;Default Value&lt;/b&gt;&lt;/font&gt;&quot; &amp; vbNewLine &amp; _
                  &quot;                       &lt;/td&gt;&quot; &amp; vbNewLine &amp; _
                  &quot;                 &lt;td align=&quot;&quot;center&quot;&quot; bgcolor=&quot;&quot;&quot; &amp; strHeadCellColor &amp; &quot;&quot;&quot;&gt; &quot; &amp; vbNewLine &amp; _
                  &quot;                       &lt;/td&gt;&quot; &amp; vbNewLine &amp;  _
                  &quot;                   &lt;/tr&gt;&quot; &amp; vbNewLine
              intI = 0
              For Each Column in Table.Columns
                  If intI = 0 Then CColor = strForumCellColor Else CColor = strAltForumCellColor
                  Response.Write  &quot;                   &lt;tr bgColor = &quot;&quot;&quot; &amp; CColor &amp; &quot;&quot;&quot;&gt;&quot; &amp; vbNewLine &amp; _
                      &quot;                       &lt;td&gt;&lt;font color=&quot;&quot;&quot; &amp; strDefaultFontColor &amp; &quot;&quot;&quot; size=&quot;&quot;&quot; &amp; strDefaultFontSize &amp; &quot;&quot;&quot; face=&quot;&quot;&quot; &amp; strDefaultFontFace &amp; &quot;&quot;&quot;&gt;&quot;&amp;Column.Name&amp;&quot;&lt;/font&gt;&lt;/td&gt;&quot; &amp; vbNewLine &amp; _
                      &quot;                       &lt;td&gt;&lt;font color=&quot;&quot;&quot; &amp; strDefaultFontColor &amp; &quot;&quot;&quot; size=&quot;&quot;&quot; &amp; strDefaultFontSize &amp; &quot;&quot;&quot; face=&quot;&quot;&quot; &amp; strDefaultFontFace &amp; &quot;&quot;&quot;&gt;&quot;
                  intCT = Column.Type
                  strType = &quot;OLEObject&quot;
                  If intCT = 2 Then strType = &quot;Small Int&quot;
                  If intCT = 3 Then strType = &quot;Long Int&quot;
                  If intCT = 4 Then strType = &quot;Single&quot;
                  If intCT = 5 Then strType = &quot;Double&quot;
                  If intCT = 6 Then strType = &quot;Currency&quot;
                  If intCT = 7 Then strType = &quot;Date&quot;
                  If intCT = 17 Then strType = &quot;Byte&quot;
                  If intCT = 72 Then strType = &quot;Replica&quot;
                  If intCT = 130 Then strType = &quot;Char&quot;
                  If intCT = 131 Then strType = &quot;Numeric&quot;
                  If intCT = 202 Then strType = &quot;Varchar&quot;
                  If intCT = 203 Then strType = &quot;Memo&quot;
                  If intCT = 204 Then strType = &quot;Attachment&quot;
                  If Column.DefinedSize = 0 Then
                      intCS = 1
                  Else
                      intCS = Column.DefinedSize
                  End If
                  If strType = &quot;Memo&quot; Then intCS = 65535
                  If Column.Properties(&quot;Nullable&quot;) Then
                      strN=&quot;&lt;b&gt;Y&lt;/b&gt; &quot;
                  Else
                      strN = &quot;&lt;font color=&quot;&quot;&quot; &amp; strHiLiteFontColor &amp; &quot;&quot;&quot;&gt;&lt;b&gt;&lt;s&gt;N&lt;/s&gt;&lt;/b&gt; &lt;/font&gt;&quot;
                  End If
                  If Column.Properties(&quot;AutoIncrement&quot;) Then
                      strType = &quot;AutoIncrement&quot;
                      strN = &quot;&lt;font color=&quot;&quot;&quot; &amp; strHiLiteFontColor &amp; &quot;&quot;&quot;&gt;&lt;b&gt;&lt;s&gt;N&lt;/s&gt;&lt;/b&gt; &lt;/font&gt;&quot;
                  End If
                  strCPD = Column.Properties(&quot;Default&quot;)
                  Response.Write  strType &amp; &quot;                     &lt;/font&gt;&lt;/td&gt;&quot; &amp; vbNewLine &amp; _
                      &quot;                       &lt;td align=right&gt;&lt;font color=&quot;&quot;&quot; &amp; strDefaultFontColor &amp; &quot;&quot;&quot; size=&quot;&quot;&quot; &amp; strDefaultFontSize &amp; &quot;&quot;&quot; face=&quot;&quot;&quot; &amp; strDefaultFontFace &amp; &quot;&quot;&quot;&gt;&quot;&amp;intCS&amp;&quot;&lt;/font&gt;&lt;/td&gt;&quot; &amp; vbNewLine &amp; _
                      &quot;                       &lt;td align=center&gt;&quot; &amp; strN &amp; &quot;&lt;/td&gt;&quot; &amp; vbNewLine &amp; _
                      &quot;                       &lt;td align=center&gt;&quot; &amp; Column.Properties(&quot;Default&quot;) &amp; &quot;&lt;/td&gt;&quot; &amp; vbNewLine &amp; _
  </code></pre>