#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Location
    Shimonoseki / JAPAN
    Posts
    58
    Rep Power
    12

    I cannot use variable to call a member of recordset. Plz look


    Lets say I have created a Recordset named MySET.
    And I have a value passed from a form: Request.Form.Key(1)

    --------------------------------
    Response.Write MySET("member") --> Prints George to screen

    Response.Write Request.Form.Key(1) --> Prints member to screen

    Val = Request.Form.Key(1)
    Response.Write Val ---> Prints member to screen

    And Finally
    Response.Write Myset(Val) ---> Returns This error:
    ADO Could not find the object in the collection corresponding to the name or ordinal reference requested by the collection.

    Now we are sure that value of the Val is "member" Why is this not working?
    I am going to go mad!!! Please help!
    Sweet smell of a great sorrow lies over the land. Plumes of smoke rise, merge into the leaden sky. A man lies and dreams of green fields and rivers, but awakes to a morning with no reason for waking. He's haunted by the memory of lost paradise. In his youth or dream, he can't be precise. He's chained forever to a world that's departed. It's not enough, it's not enough.
    Gilmour
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2001
    Location
    NJ
    Posts
    428
    Rep Power
    17
    how bout pasting a code block?
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Location
    Shimonoseki / JAPAN
    Posts
    58
    Rep Power
    12
    I found the problem....
    I trimmed the VAL variable and it solved

    Actually it has no spaces at all. When I write it many times without any carriage return or space, It seems like this:

    membermembermembermember

    But strangely doesn't work without Trim...
    Sweet smell of a great sorrow lies over the land. Plumes of smoke rise, merge into the leaden sky. A man lies and dreams of green fields and rivers, but awakes to a morning with no reason for waking. He's haunted by the memory of lost paradise. In his youth or dream, he can't be precise. He's chained forever to a world that's departed. It's not enough, it's not enough.
    Gilmour
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2001
    Location
    NJ
    Posts
    428
    Rep Power
    17
    you were prolly putting a space after member in the form. in such case, its not very weird that you have to use trim, because the variable will contain member and trailing space, so equivalently is val is "member " which has no column in the database.

IMN logo majestic logo threadwatch logo seochat tools logo