ASP/Access 2002: how do I get column names from table (in order) using OLE DB?

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

  1. #1

    Default ASP/Access 2002: how do I get column names from table (in order) using OLE DB?

    When I use ADOX to get columns(fields) of a table, they are *auto-sorted
    alphabetically by name*.
    I need to get the list of field names as they appear when I open the MDB
    file and view details of the table, *not* sorted by field name
    alphabetically.
    I tried using open schema with following code causing this error msg: "Item
    cannot be found in the collection corresponding to the requested name or
    ordinal"
    Set rsSchema = conn.OpenSchema(4, Array(Empty, Empty, "config"))
    rsSchema.Sort = "ORDINAL_POSITION"
    Thanks!
    --
    Scotter


    Scotter Guest

  2. Similar Questions and Discussions

    1. Pulling table column names
      How can I pull table column names? I would like to put then in menu / cfselect statment. Thanks, Matthew
    2. querying field / column names in Access table
      I got great info on my last post, so let's try this one and see if my luck is still good: I have an Access table with about 30+ columns / fields...
    3. ASP/Access2002: how do I get column names from table (in order) using OLE DB?
      When I use ADOX to get columns(fields) of a table, they are auto-sorted alphabetically by name. I need to get the list of field names as they...
    4. Access table names
      That depends on exactly what you are doing. But basically 'work' is a keyword, which is why the problem occurs. If you reference it as it...
    5. asp get Table Column ( Show Active Users Names Logged On )
      Hello; I know how to get a "Database Table" with ASP. But what I am trying to get is the Table Column. This is what I am needing. ( Could...
  3. #2

    Default RE: ASP/Access 2002: how do I get column names from table (in order) using OLE DB?

    Hi Scotter,

    Have you set the cursor's location to client side? I have tested following
    code and it seems to work:

    Dim rsSchema
    Dim cnn

    Set cnn = CreateObject("ADODB.connection")

    cnn.CursorLocation = 3
    cnn.Provider = "Microsoft.Jet.OLEDB.4.0;"
    cnn.Open "Data Source=C:\db1.mdb;"

    Set rsSchema = cnn.OpenSchema(4, Array(Empty, Empty, "table1"))
    rsSchema.Sort = "ORDINAL_POSITION"


    Luke

    [MSFT] Guest

  4. #3

    Default Re: ASP/Access 2002: how do I get column names from table (in order) using OLE DB?

    Why do you keep posting the same message multiple times? Hitting send once
    is usually sufficient.

    [url]http://www.aspfaq.com/search.asp?q=schema[/url]

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




    "Scotter" <spam@spam.com> wrote in message
    news:YF5Ec.33065$w3.6459@fe2.texas.rr.com...
    > When I use ADOX to get columns(fields) of a table, they are *auto-sorted
    > alphabetically by name*.
    > I need to get the list of field names as they appear when I open the MDB
    > file and view details of the table, *not* sorted by field name
    > alphabetically.
    > I tried using open schema with following code causing this error msg:
    "Item
    > cannot be found in the collection corresponding to the requested name or
    > ordinal"
    > Set rsSchema = conn.OpenSchema(4, Array(Empty, Empty, "config"))
    > rsSchema.Sort = "ORDINAL_POSITION"
    > Thanks!
    > --
    > Scotter
    >
    >

    Aaron [SQL Server MVP] Guest

  5. #4

    Default Re: ASP/Access 2002: how do I get column names from table (in order) using OLE DB?

    Thanks! Yeah problem was I left out the cursorlocation=3

    "[MSFT]" <lukezhan@online.microsoft.com> wrote in message
    news:47kIARbXEHA.3788@cpmsftngxa10.phx.gbl...
    > Hi Scotter,
    >
    > Have you set the cursor's location to client side? I have tested following
    > code and it seems to work:
    >
    > Dim rsSchema
    > Dim cnn
    >
    > Set cnn = CreateObject("ADODB.connection")
    >
    > cnn.CursorLocation = 3
    > cnn.Provider = "Microsoft.Jet.OLEDB.4.0;"
    > cnn.Open "Data Source=C:\db1.mdb;"
    >
    > Set rsSchema = cnn.OpenSchema(4, Array(Empty, Empty, "table1"))
    > rsSchema.Sort = "ORDINAL_POSITION"
    >
    >
    > Luke
    >

    Scotter 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