Professional Web Applications Themes

ASP Access Autonumber property - ASP Database

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 rample = cnnConnection.EXECUTE("SELECT * FROM Table") For Each cmnColumn in rample.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 ...

  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 rample = cnnConnection.EXECUTE("SELECT * FROM Table")

    For Each cmnColumn in rample.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. #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" <mbiangrockisu.com> wrote in message
    news:8d00393f.0408110914.1c54b38bposting.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 rample = cnnConnection.EXECUTE("SELECT * FROM Table")
    >
    > For Each cmnColumn in rample.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

Similar Threads

  1. #40159 [NEW]: Cannot access protected property
    By dominik dot bulaj at gmail dot com in forum PHP Bugs
    Replies: 3
    Last Post: February 22nd, 10:50 AM
  2. #40159 [Opn->Fbk]: Cannot access protected property
    By tony2001@php.net in forum PHP Bugs
    Replies: 0
    Last Post: January 18th, 11:22 AM
  3. Replies: 0
    Last Post: November 13th, 11:04 AM
  4. Access to Session Object Property
    By Dorsa in forum ASP.NET Security
    Replies: 1
    Last Post: December 17th, 06:45 PM
  5. Help Anyone?How do I access Inner Class Property
    By Nigil LaVey in forum ASP.NET Building Controls
    Replies: 0
    Last Post: November 3rd, 12:27 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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