Variable in the field name.

Discussion in 'ASP General' started by my, Jul 21, 2003.

  1. my

    my Guest

    Hi All,

    I have one question. Usually, we can get data from table
    by using rst("userid") because we know the column name
    userid. Now, I have a variable to hold the column name. I
    want to get data value like this rst(var1). However, I got
    an error message.

    Thanks.
    my
     
    my, Jul 21, 2003
    #1
    1. Advertising

  2. What was the error message? Make sure that the variable does not contain any
    leading/trailing spaces. A better idea is to do:

    rst(Trim(var1))

    Also, print out the variable and see if that field exists in the resultset.

    --
    Manohar Kamath
    Editor, .netBooks
    www.dotnetbooks.com


    "my" <> wrote in message
    news:03ed01c34fd0$60fc1170$...
    > Hi All,
    >
    > I have one question. Usually, we can get data from table
    > by using rst("userid") because we know the column name
    > userid. Now, I have a variable to hold the column name. I
    > want to get data value like this rst(var1). However, I got
    > an error message.
    >
    > Thanks.
    > my
     
    Manohar Kamath [MVP], Jul 21, 2003
    #2
    1. Advertising

  3. What is the code? What is "var1"? What does the table structure look like?
    What is the error message?

    In case there's any doubt, some information is better than none. :)


    "my" <> wrote in message
    news:03ed01c34fd0$60fc1170$...
    > Hi All,
    >
    > I have one question. Usually, we can get data from table
    > by using rst("userid") because we know the column name
    > userid. Now, I have a variable to hold the column name. I
    > want to get data value like this rst(var1). However, I got
    > an error message.
    >
    > Thanks.
    > my
     
    Aaron Bertrand - MVP, Jul 21, 2003
    #3
    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. Bobby Chamness
    Replies:
    2
    Views:
    2,415
    Joe Smith
    Apr 22, 2007
  2. John Davis
    Replies:
    2
    Views:
    407
    Dave Anderson
    Aug 18, 2003
  3. Pavils Jurjans
    Replies:
    3
    Views:
    207
    Pavils Jurjans
    Mar 18, 2005
  4. Sound
    Replies:
    2
    Views:
    465
    Randy Webb
    Sep 28, 2006
  5. jr
    Replies:
    3
    Views:
    451
Loading...

Share This Page