Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2005
    Posts
    6

    Unanswered: ADODB.Fields (0x800A0CC1)!!!

    I get the error ADODB.Fields (0x800A0CC1)
    Item cannot be found in the collection corresponding to the requested name or ordinal.

    I know what is happening in that there is no data for the specified field.

    Basically I have a crosstab in access displaying the results of a query, but I am unable to view this via my asp page as not all the fields have a value as yet.

    I think I can over come this either one of two ways.

    1. Get the cross tab to display 0 instead of displaying nothing when their is nothing to count

    or

    2. Somehow get the asp page to return a null or 0 value if nothing appears from the query.


    The query in access is as follows.

    Code:
    TRANSFORM Count(statusreporthsc.SDC1) AS CountOfSDC1
    SELECT statusreporthsc.date2, Count(statusreporthsc.SDC1) AS [Total Of SDC1]
    FROM statusreporthsc
    GROUP BY statusreporthsc.date2
    PIVOT statusreporthsc.Category;
    and the section of the asp page displaying the results is as follows

    Code:
        <tr>
          <td align="left" width="14%"><%=(Recordset1.Fields.Item("date2").Value)%> </td>
          <td align="left" width="14%"><%=(Recordset1.Fields.Item("HOD (SDC) Request").Value)%> </td>
          <td align="left" width="14%"><%=(Recordset1.Fields.Item("Mini Consultancy").Value) %> </td>
          <td align="left" width="14%"><%=(Recordset1.Fields.Item("Mini Project").Value)%> </td>
          <td align="left" width="14%"><%=(Recordset1.Fields.Item("Site Project").Value)%> </td>
          <td align="left" width="14%"><%=(Recordset1.Fields.Item("Total Of SDC1").Value)%> </td>
        </tr>
        <%
    I really hope this makes sense to someone and you can help me.

    Many thanks

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    you could try something like this....
    Code:
        <tr>
          <%
          fieldcount = Recordset1.Fields.Count
          for n = 0 to fieldcount -1
          %>
          <td align="left" width="14%"><%=(Recordset1.Fields(n))%> </td>
          <%
          next
          %>
        </tr>
    It's been ages since I have done something like that so the syntax probably isn't quite right but you should be able to get it there.

  3. #3
    Join Date
    Jun 2003
    Location
    USA
    Posts
    1,032
    I get the error ADODB.Fields (0x800A0CC1)
    Item cannot be found in the collection corresponding to the requested name or ordinal.

    I know what is happening in that there is no data for the specified field.
    In my opinion it means that the field itself doesn't exist (regardless of whether it might contain data or not).
    J. Paul Schmidt, Freelance Web and Database Developer
    www.Bullschmidt.com
    Access Database Sample, Web Database Sample, ASP Design Tips

  4. #4
    Join Date
    Oct 2005
    Posts
    178
    DOn't forget your field index as..

    Recordset1.Fields(i)

  5. #5
    Join Date
    Nov 2005
    Location
    Honolulu HI
    Posts
    119
    Paul is right.

    you are trying to display a piece of data (field) but that field is not contained in teh recordest you are building.

    one of those 6 fields is not in the recordset. data content doesnt matter
    .
    .
    http://www.HawaiianHope.org
    Providing Technology services to non profit orgs, Homeless Shelters, Food Pantries, Clean And Sober Houses and more.
    To date we have given away over 900 free computers !
    __________________________
    caeli enarrant gloriam Dei !

  6. #6
    Join Date
    Oct 2005
    Posts
    178
    SInce you already have your Data Source as Recordset1, use for example
    <%= Recordset1("date2") %>
    or if using array fields use the index
    as ..
    <%= Recordset1.fields(0).value %>
    <%= Recordset1.fields(1).value %>

    The way you have it does not specify the fields that's why you are having the fields error.

    check rokslide posting above for format
    Last edited by fredservillon; 01-16-06 at 11:18.

Posting Permissions

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