ASP Access Autonumber property

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default ASP Access Autonumber property

    Hi, I am wondering if there is a way to retrieve wether a given column
    in an Access Database is an autonumber as opposed to just an integer.
    Currently I am just retreiving all of the columns from a table in a
    recordset, and am able to determine the datatype of all of the
    columns. Here is my example code.

    Set rsExample = cnnConnection.EXECUTE("SELECT * FROM Table")

    For Each cmnColumn in rsExample.Fields
    if(cmnColumn.TYPE = 3) then
    'This is a numeric field
    'Here I would like to determine if this column is an
    autonumber as opposed to a number. Both have TYPE = 3
    else
    'This field is non-numeric
    end if
    Next

    Both AutoNumbers and Number return a type = 3. Is there another way
    to accomplish this?

    Mike Biang
    Web Applications Developer
    Cramer Development
    mike Guest

  2. Similar Questions and Discussions

    1. #40159 [NEW]: Cannot access protected property
      From: dominik dot bulaj at gmail dot com Operating system: Debian PHP version: 5.2.0 PHP Bug Type: Class/Object related Bug...
    2. #40159 [Opn->Fbk]: Cannot access protected property
      ID: 40159 Updated by: tony2001@php.net Reported By: dominik dot bulaj at gmail dot com -Status: Open +Status: ...
    3. #29234 [Com]: empty($object->property) incorrect when property has access overloaded (__get)
      ID: 29234 Comment by: phpbugs at thunder-2000 dot com Reported By: chrissy at codegoat dot com Status: No...
    4. Access to Session Object Property
      Hi, I am new to ASP.net and VB.net. I need to store a class(SecurityClass) with a property ( LoggedIn as Boolean) in the Session Object (Called...
    5. Help Anyone?How do I access Inner Class Property
      hi guys, I am having this problems too... if I inherits it from System.Web.UI.WebControl.WebControls.. it works fine.. but if I inherits it from...
  3. #2

    Default Re: ASP Access Autonumber property

    There is an IsAutoIncrement property. I just updated the last sample at
    [url]http://www.aspfaq.com/2177[/url] and it might help.

    --
    [url]http://www.aspfaq.com/[/url]
    (Reverse address to reply.)




    "mike" <mbiang@rockisu.com> wrote in message
    news:8d00393f.0408110914.1c54b38b@posting.google.c om...
    > Hi, I am wondering if there is a way to retrieve wether a given column
    > in an Access Database is an autonumber as opposed to just an integer.
    > Currently I am just retreiving all of the columns from a table in a
    > recordset, and am able to determine the datatype of all of the
    > columns. Here is my example code.
    >
    > Set rsExample = cnnConnection.EXECUTE("SELECT * FROM Table")
    >
    > For Each cmnColumn in rsExample.Fields
    > if(cmnColumn.TYPE = 3) then
    > 'This is a numeric field
    > 'Here I would like to determine if this column is an
    > autonumber as opposed to a number. Both have TYPE = 3
    > else
    > 'This field is non-numeric
    > end if
    > Next
    >
    > Both AutoNumbers and Number return a type = 3. Is there another way
    > to accomplish this?
    >
    > Mike Biang
    > Web Applications Developer
    > Cramer Development

    Aaron [SQL Server MVP] Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139