Another basic sql

Discussion in 'ASP General' started by Jeff, Jan 11, 2006.

  1. Jeff

    Jeff Guest

    ok. using access and asp, can someone tell me why i would be getting this
    error?

    script

    set admin4 = conn.execute("select count(username) as cnt3 from members2
    where username not in (select top 16 username from members2 order by
    total_score desc)")

    error

    Item cannot be found in the collection corresponding to the requested name
    or ordinal.

    /GIG/Tourney/admin/td_admin.asp, line 11

    username and total_score are both in the table. could it be because there
    aren't 16 records present yet??

    Bam
     
    Jeff, Jan 11, 2006
    #1
    1. Advertising

  2. What does the code on line 11 look like? How are you attempting to get your
    count value? You're not doing yourRS("username"), are you?

    Does this query work when you copy and paste it into the query window in
    Access?

    Ray at home


    "Jeff" <> wrote in message
    news:...
    > ok. using access and asp, can someone tell me why i would be getting this
    > error?
    >
    > script
    >
    > set admin4 = conn.execute("select count(username) as cnt3 from members2
    > where username not in (select top 16 username from members2 order by
    > total_score desc)")
    >
    > error
    >
    > Item cannot be found in the collection corresponding to the requested name
    > or ordinal.
    >
    > /GIG/Tourney/admin/td_admin.asp, line 11
    >
    > username and total_score are both in the table. could it be because there
    > aren't 16 records present yet??
    >
    > Bam
    >
    >
     
    Ray Costanzo [MVP], Jan 12, 2006
    #2
    1. Advertising

  3. Jeff

    Jeff Guest

    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:...
    > What does the code on line 11 look like?


    Line 11 is what I pasted in my post

    How are you attempting to get your
    > count value? You're not doing yourRS("username"), are you?


    i am getting the count value in the beginning if the statement as cnt3
    count(username) as cnt3

    i entered this into access:

    SELECT count(username) AS cnt3
    FROM members2
    WHERE username not in (select top 16 username from members2 order by
    total_score desc)

    and i don't get an error. it displays the output as it should.
    so the error lies on the asp page somewhere??



    >
    > Does this query work when you copy and paste it into the query window in
    > Access?
    >
    > Ray at home
    >
    >
    > "Jeff" <> wrote in message
    > news:...
    >> ok. using access and asp, can someone tell me why i would be getting this
    >> error?
    >>
    >> script
    >>
    >> set admin4 = conn.execute("select count(username) as cnt3 from members2
    >> where username not in (select top 16 username from members2 order by
    >> total_score desc)")
    >>
    >> error
    >>
    >> Item cannot be found in the collection corresponding to the requested
    >> name or ordinal.
    >>
    >> /GIG/Tourney/admin/td_admin.asp, line 11
    >>
    >> username and total_score are both in the table. could it be because there
    >> aren't 16 records present yet??
    >>
    >> Bam
    >>
    >>

    >
    >
     
    Jeff, Jan 12, 2006
    #3
  4. Jeff

    Jeff Guest

    ok. i feel like a complete idiot. i figured it out.
    should have been admin3 not admin4
    thanks anyway

    bam


    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:...
    > What does the code on line 11 look like? How are you attempting to get
    > your count value? You're not doing yourRS("username"), are you?
    >
    > Does this query work when you copy and paste it into the query window in
    > Access?
    >
    > Ray at home
    >
    >
    > "Jeff" <> wrote in message
    > news:...
    >> ok. using access and asp, can someone tell me why i would be getting this
    >> error?
    >>
    >> script
    >>
    >> set admin4 = conn.execute("select count(username) as cnt3 from members2
    >> where username not in (select top 16 username from members2 order by
    >> total_score desc)")
    >>
    >> error
    >>
    >> Item cannot be found in the collection corresponding to the requested
    >> name or ordinal.
    >>
    >> /GIG/Tourney/admin/td_admin.asp, line 11
    >>
    >> username and total_score are both in the table. could it be because there
    >> aren't 16 records present yet??
    >>
    >> Bam
    >>
    >>

    >
    >
     
    Jeff, Jan 12, 2006
    #4
  5. Jeff

    Bob Lehmann Guest

    >> should have been admin3 not admin4
    Neither of which were mentioned in you r original post.

    Bob Lehmann

    "Jeff" <> wrote in message
    news:...
    > ok. i feel like a complete idiot. i figured it out.
    > should have been admin3 not admin4
    > thanks anyway
    >
    > bam
    >
    >
    > "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    > message news:...
    > > What does the code on line 11 look like? How are you attempting to get
    > > your count value? You're not doing yourRS("username"), are you?
    > >
    > > Does this query work when you copy and paste it into the query window in
    > > Access?
    > >
    > > Ray at home
    > >
    > >
    > > "Jeff" <> wrote in message
    > > news:...
    > >> ok. using access and asp, can someone tell me why i would be getting

    this
    > >> error?
    > >>
    > >> script
    > >>
    > >> set admin4 = conn.execute("select count(username) as cnt3 from members2
    > >> where username not in (select top 16 username from members2 order by
    > >> total_score desc)")
    > >>
    > >> error
    > >>
    > >> Item cannot be found in the collection corresponding to the requested
    > >> name or ordinal.
    > >>
    > >> /GIG/Tourney/admin/td_admin.asp, line 11
    > >>
    > >> username and total_score are both in the table. could it be because

    there
    > >> aren't 16 records present yet??
    > >>
    > >> Bam
    > >>
    > >>

    > >
    > >

    >
    >
     
    Bob Lehmann, Jan 12, 2006
    #5
  6. No worries. All that matters is that it's fixed.

    Ray at work

    "Jeff" <> wrote in message
    news:...
    > ok. i feel like a complete idiot. i figured it out.
    > should have been admin3 not admin4
    > thanks anyway
    >
    > bam
     
    Ray Costanzo [MVP], Jan 12, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jesse
    Replies:
    7
    Views:
    362
    Ron Natalie
    Nov 6, 2003
  2. Engineer
    Replies:
    6
    Views:
    628
    Jeremy Bowers
    May 1, 2005
  3. Replies:
    0
    Views:
    439
  4. ecoolone
    Replies:
    0
    Views:
    766
    ecoolone
    Jan 3, 2008
  5. Rob R. Ainscough
    Replies:
    3
    Views:
    332
    Rob R. Ainscough
    Jun 14, 2005
Loading...

Share This Page